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.
2.8 KiB
2.8 KiB