diff --git a/components/net/cpp/src/peer.cpp b/components/net/cpp/src/peer.cpp index 853b91d26c213a74fc83a5f99706e7b6282dec76..5e301ea846826e87883d5e9f060de990e3a4f2a9 100644 --- a/components/net/cpp/src/peer.cpp +++ b/components/net/cpp/src/peer.cpp @@ -83,6 +83,9 @@ static SOCKET tcpConnect(URI &uri) { return INVALID_SOCKET; } + int flags =1; + if (setsockopt(csocket, IPPROTO_TCP, TCP_NODELAY, (const char *)&flags, sizeof(flags))) { LOG(ERROR) << "ERROR: setsocketopt(), TCP_NODELAY"; }; + addrinfo hints = {}, *addrs; hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; @@ -163,6 +166,9 @@ Peer::Peer(SOCKET s, Universe *u, Dispatcher *d) : sock_(s), can_reconnect_(fals is_waiting_ = true; scheme_ = ftl::URI::SCHEME_TCP; + + int flags =1; + if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (const char *)&flags, sizeof(flags))) { LOG(ERROR) << "ERROR: setsocketopt(), TCP_NODELAY"; }; // Send the initiating handshake if valid if (status_ == kConnecting) {