Skip to content
Snippets Groups Projects
Commit e2fdb748 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Add TCP_NODELAY

parent dac415e4
No related branches found
No related tags found
1 merge request!40Implements #89 PNG chunking
Pipeline #11603 failed
......@@ -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;
......@@ -164,6 +167,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) {
// Install return handshake handler.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment