Try both fd and socket ops for net_read() and net_write()
commit3e2b8405658c9fa521c8bc6457cefaf7cce6cbe6
authorAsanka Herath <asanka@secure-endpoints.com>
Wed, 26 May 2010 14:33:50 +0000 (26 10:33 -0400)
committerAsanka Herath <asanka@secure-endpoints.com>
Wed, 26 May 2010 14:38:44 +0000 (26 10:38 -0400)
tree9e5c47bbc25567ac86515ba8e043fcdefacb3ea8
parent5c0f3f99c6a062278dd4b4ce9aa52edfb2151e59
Try both fd and socket ops for net_read() and net_write()

When using WinSock, a socket is not a file descriptor and does not
interoperate with read()/write().  File descriptors do not work with
send()/recv().  However, for net_read() and net_write(), we don't know
whether we are dealing with a socket or a file descriptor.  So try
one, and if it fails, try the other.

This is an ugly hack until we clean up the users of this API so it
doesn't use sockets and fds interchangably.
lib/roken/net_read.c
lib/roken/net_write.c