From 7601a5adca71f10ad1cb63292c769b7b9a35dd08 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Wed, 16 May 2012 15:16:40 -0700 Subject: [PATCH] rstream: Always set TCP_NODELAY on rsocket The NODELAY option is coupled with whether the socket is blocking or nonblocking. Remove this coupling and always set the NODELAY option. NODELAY currently has no affect on rsockets. Signed-off-by: Sean Hefty --- examples/rstream.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/examples/rstream.c b/examples/rstream.c index decb2041..8d5a22dc 100644 --- a/examples/rstream.c +++ b/examples/rstream.c @@ -57,7 +57,6 @@ static int use_rs = 1; static int use_async; static int verify; static int flags = MSG_DONTWAIT; -static int no_delay = 1; static int custom; static int iterations = 1; static int transfer_size = 1000; @@ -324,10 +323,8 @@ static void set_options(int rs) break; } - if (no_delay) { - rs_setsockopt(rs, IPPROTO_TCP, TCP_NODELAY, - (void *) &no_delay, sizeof(no_delay)); - } + rs_setsockopt(rs, IPPROTO_TCP, TCP_NODELAY, + (void *) &no_delay, sizeof(no_delay)); if (flags & MSG_DONTWAIT) { rs_fcntl(rs, F_SETFL, O_NONBLOCK); @@ -488,11 +485,9 @@ static int set_test_opt(char *optarg) break; case 'b': flags &= ~MSG_DONTWAIT; - no_delay = 0; break; case 'n': flags |= MSG_DONTWAIT; - no_delay = 1; break; case 'v': verify = 1; @@ -507,10 +502,8 @@ static int set_test_opt(char *optarg) use_async = 1; } else if (!strncasecmp("block", optarg, 5)) { flags &= ~MSG_DONTWAIT; - no_delay = 0; } else if (!strncasecmp("nonblock", optarg, 8)) { flags |= MSG_DONTWAIT; - no_delay = 1; } else if (!strncasecmp("verify", optarg, 6)) { verify = 1; } else { -- 2.46.0