[ovs-dev] [PATCH 4/4] stream-ssl: Add support for windows platform.

Ben Pfaff blp at nicira.com
Fri Feb 7 01:00:37 UTC 2014


On Thu, Feb 06, 2014 at 08:12:33AM -0800, Gurucharan Shetty wrote:
> This commit creates events and associates them with
> socket file descriptors to get woken up from poll_block().
> One difference with the Linux implementation is that
> we cannot register for separate network events with poll_block().
> i.e., we cannot say, we only should be woken up for POLLIN or POLLOUT.
> So this would mean that we will be woken up from poll_block() more
> often.

I don't understand how this can really work.  It means that we'll spin
with 100% CPU if we're waiting for the TX window to open up but
there's data ready to be received.  I doubt that's acceptable, is
there anything we can do?

> Some other changes:
> 
> * Windows does not have sys/fcntl.h but has a fcntl.h
> On Linux, there is fctnl.h too.

Interesting.  <fcntl.h> is actually the standardized name, so it's
better to use that name anyway.

> * SHUT_RDWR is equivalent to SD_BOTH on Windows.
> 
> Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>

I'd consider adding to socket-util.h:

    #ifndef _WIN32
    #define closesocket close
    #endif

so that we don't need a close_socket() in multiple files.

Would it make anything cleaner or easier to turn stream-ssl from a
direct user of sockets, into a user of a nested stream-tcp?

Thanks,

Ben.



More information about the dev mailing list