Merge pull request #729 from iamthad/tcp-nodelay-on-udp

Disable setting TCP_NODELAY on UDP sockets
This commit is contained in:
Alex Lin 2019-01-31 07:43:23 -06:00 committed by GitHub
commit a2cee328d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 11 deletions

View File

@ -29,7 +29,6 @@ int tc_init_udp_client(TCDevice * udp_client_device)
int debug = 1;
int on = 1;
struct hostent *h;
int the_socket;
struct sockaddr_in sockin;
@ -60,10 +59,6 @@ int tc_init_udp_client(TCDevice * udp_client_device)
return (TC_COULD_NOT_OPEN_SOCKET);
}
/* Turn off data buffering. This causes data to be sent immediately rather than queuing it up until the transmit
buffer is filled. */
setsockopt(the_socket, IPPROTO_TCP, TCP_NODELAY, (const char *) &on, (socklen_t) sizeof(on));
sockin.sin_family = TRICKCOMM_SOCKET_FAMILY;
sockin.sin_addr.s_addr = htonl(INADDR_ANY);
sockin.sin_port = htons(0);

View File

@ -59,12 +59,6 @@ int tc_init_udp_server( /* RETURN: -- 0 for success */
return (-1);
}
/* Turn off data buffering. This causes data to be written immediately to the receiving socket rather than queing
it up until the transmit buffer is filled. */
setsockopt(udp_server_device->socket, IPPROTO_TCP, TCP_NODELAY, (const char *) &yes, (socklen_t) sizeof(yes));
sockin.sin_addr.s_addr = INADDR_ANY;
sockin.sin_family = TRICKCOMM_SOCKET_FAMILY;
sockin.sin_port = htons((short) (udp_server_device->port));