[ovs-dev] [PATCH v2] stream-tcp: Call setsockopt TCP_NODELAY after TCP is connected.

Gurucharan Shetty shettyg at nicira.com
Thu Oct 23 18:16:47 UTC 2014


On Thu, Oct 23, 2014 at 8:49 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Wed, Oct 22, 2014 at 04:09:56PM -0700, Gurucharan Shetty wrote:
>> On Windows platform, TCP_NODELAY can only be set when TCP is established.
>> (This is an observed behavior and not written in any MSDN documentation.)
>> The current code does not create any problems while running unit tests
>> (because connections get established immediately) but is reportedly
>> observed while connecting to a different machine.
>>
>> commit 8b76839(Move setsockopt TCP_NODELAY to when TCP is connected.)
>> made changes to call setsockopt with TCP_NODELAY after TCP is connected
>> only in lib/stream-ssl.c. We need the same change for stream-tcp too and
>> this commit does that.
>>
>> Currently, a failure of setting TCP_NODELAY results in reporting
>> the error and then closing the socket. This commit changes that
>> behavior such that an error is reported if setting TCP_NODELAY
>> fails, but the connection itself is not torn down.
>>
>> Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
>
> This seems reasonable to me.  Thank you!
>
> One could use AF_UNIX and AF_INET to represent the types of sockets
> instead of inventing a new pair of macros.
Yes. Using AF_UNIX and AF_INET is better. I made that change.
>
> Acked-by: Ben Pfaff <blp at nicira.com>
and applied this. Thanks!



More information about the dev mailing list