mirror of
https://github.com/nasa/trick.git
synced 2024-12-20 05:37:55 +00:00
Merge pull request #729 from iamthad/tcp-nodelay-on-udp
Disable setting TCP_NODELAY on UDP sockets
This commit is contained in:
commit
a2cee328d2
@ -29,7 +29,6 @@ int tc_init_udp_client(TCDevice * udp_client_device)
|
|||||||
|
|
||||||
int debug = 1;
|
int debug = 1;
|
||||||
|
|
||||||
int on = 1;
|
|
||||||
struct hostent *h;
|
struct hostent *h;
|
||||||
int the_socket;
|
int the_socket;
|
||||||
struct sockaddr_in sockin;
|
struct sockaddr_in sockin;
|
||||||
@ -60,10 +59,6 @@ int tc_init_udp_client(TCDevice * udp_client_device)
|
|||||||
return (TC_COULD_NOT_OPEN_SOCKET);
|
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_family = TRICKCOMM_SOCKET_FAMILY;
|
||||||
sockin.sin_addr.s_addr = htonl(INADDR_ANY);
|
sockin.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||||
sockin.sin_port = htons(0);
|
sockin.sin_port = htons(0);
|
||||||
|
@ -59,12 +59,6 @@ int tc_init_udp_server( /* RETURN: -- 0 for success */
|
|||||||
return (-1);
|
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_addr.s_addr = INADDR_ANY;
|
||||||
sockin.sin_family = TRICKCOMM_SOCKET_FAMILY;
|
sockin.sin_family = TRICKCOMM_SOCKET_FAMILY;
|
||||||
sockin.sin_port = htons((short) (udp_server_device->port));
|
sockin.sin_port = htons((short) (udp_server_device->port));
|
||||||
|
Loading…
Reference in New Issue
Block a user