# # # patch "ChangeLog" # from [5644559f6a9fa4bed57f7789dc87503578566c2c] # to [71b558f87331e3d3a0693cf837ac230ffd8e233d] # # patch "netsync.cc" # from [81c12af4a0791840ac675220fd06bee263434554] # to [593980f4f4e99f3e5b694389f44b0f5f046ea2fa] # ============================================================ --- ChangeLog 5644559f6a9fa4bed57f7789dc87503578566c2c +++ ChangeLog 71b558f87331e3d3a0693cf837ac230ffd8e233d @@ -1,3 +1,7 @@ +2006-01-20 Timothy Brownawell + + * netsync.cc: Make our sockets non-blocking. + 2006-01-19 Emile Snyder Add a --brief mode to the annotate command which prints more ============================================================ --- netsync.cc 81c12af4a0791840ac675220fd06bee263434554 +++ netsync.cc 593980f4f4e99f3e5b694389f44b0f5f046ea2fa @@ -45,6 +45,7 @@ #include "netxx/peer.h" #include "netxx/probe.h" #include "netxx/socket.h" +#include "netxx/sockopt.h" #include "netxx/stream.h" #include "netxx/streamserver.h" #include "netxx/timeout.h" @@ -2236,9 +2237,15 @@ P(F("connecting to %s\n") % address()); Netxx::Address addr(address().c_str(), default_port, use_ipv6); Netxx::Stream server(addr, timeout); + + // 'false' here means not to revert changes when the SockOpt + // goes out of scope. + SockOpt socket_options(server.get_socketfd(), false); + socket_options.set_non_blocking(); + session sess(role, client_voice, include_pattern, exclude_pattern, app, address(), server.get_socketfd(), timeout); - + while (true) { bool armed = false; @@ -2384,6 +2391,12 @@ { P(F("accepted new client connection from %s : %s\n") % client.get_address() % lexical_cast(client.get_port())); + + // 'false' here means not to revert changes when the SockOpt + // goes out of scope. + SockOpt socket_options(client.get_socketfd(), false); + socket_options.set_non_blocking(); + shared_ptr sess(new session(role, server_voice, include_pattern, exclude_pattern, app,