From 1822a0a6f82e47f688e374cd48e4c497b2fb15e6 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 4 Apr 2008 17:13:27 +0200 Subject: * digital/avr/modules/host, host/mex: - added TCP_NODELAY option. --- digital/avr/modules/host/socket.host.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'digital') diff --git a/digital/avr/modules/host/socket.host.c b/digital/avr/modules/host/socket.host.c index 9953b3a9..f91140af 100644 --- a/digital/avr/modules/host/socket.host.c +++ b/digital/avr/modules/host/socket.host.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -72,6 +73,13 @@ socket_client (const char *addr, const char *port) perror ("socket"); exit (EXIT_FAILURE); } + int on = 1; + if (setsockopt (s, IPPROTO_TCP, TCP_NODELAY, (void *) &on, sizeof (on)) + < 0) + { + perror ("setsockopt (NODELAY)"); + exit (EXIT_FAILURE); + } if (connect (s, (struct sockaddr *) &saddr, sizeof (saddr)) < 0) { perror ("connect"); -- cgit v1.2.3