diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-01-09 11:28:51 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-01-09 11:28:51 -0500 |
commit | 061a8a6e99cbbbb858c71cfa847194f72789753e (patch) | |
tree | 04b7b9eb5372dce031fd4daa6cadd44c263e6492 /netlib.c | |
parent | 58f23f153092c4c928027d53b0e253e8359c5023 (diff) | |
download | gpsd-061a8a6e99cbbbb858c71cfa847194f72789753e.tar.gz |
Explain some magic.
Diffstat (limited to 'netlib.c')
-rw-r--r-- | netlib.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -115,8 +115,15 @@ socket_t netlib_connectsock(int af, const char *host, const char *service, } #endif #ifdef TCP_NODELAY + /* + * This is a good performance enhancement when the socket is going to + * be used to pass a lot of short commands. It prevents them from being + * delayed by the Nagle algorithm until they can be aggreagated into + * a large packet. See http://en.wikipedia.org/wiki/Nagle%27s_algorithm + * for discussion. + */ if (type == SOCK_STREAM) - setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *)&one, sizeof one); + setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *)&one, sizeof(one)); #endif /* set socket to noblocking */ |