X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/59c5fae425dbeaf0d37b0bf19756c8b2063d38ae..eca5a3ad10166cf4c975879e40ad44491961ca3b:/tests/skstream/broadcaster_udp.cpp?ds=sidebyside diff --git a/tests/skstream/broadcaster_udp.cpp b/tests/skstream/broadcaster_udp.cpp index 0955011..6bce04d 100644 --- a/tests/skstream/broadcaster_udp.cpp +++ b/tests/skstream/broadcaster_udp.cpp @@ -14,16 +14,11 @@ #include #include #include +// FIXME +#include using namespace std; -//class test { -// public: -// int i; - //test(void): i(10) {} - //test(int i): i(i) {} -//}; - int main(int argc, char* argv[]) { // Necesita argumentos. if (argc < 3 || argc > 4) { @@ -37,11 +32,6 @@ int main(int argc, char* argv[]) { return 1; } -//test t; -//cerr << t.i << endl; -//udp_socket_stream s; -//s.is_open(); - // Obtengo host y puerto. string host = argv[1]; unsigned port; @@ -52,21 +42,16 @@ int main(int argc, char* argv[]) { // Socket TCP. udp_socket_stream socket; - if (!socket.is_open()) { - cerr << "No está conectado." << endl; - } if (!socket.setTarget(host, port)) { - //if (!sock.is_open()) { cerr << "No se pudo configurar el destino (" << host << ":" << port << ")." << ")." << endl; return 2; } - char buff[4096]; - // Envio pedido. - while (cin.getline(buff, 4096)) { - socket << buff << endl; + while (true) { + socket << "hola mundo." << endl; + sleep(1); } return 0;