CSize is 64 bits on 64-bit machines, while socklen_t might be 32 bits. We now use unsigned int (i.e. CUInt) instead, which is what the 64-bit Linux machine I tested on uses. This is not entirely correct, as C doesn't guarantee that unsigned long or socklen_t is exactly 32-bits, but it works in practice. Closes #81
…HC command line
This commit assumes we no longer care about Hugs. The code it replaces apparently didn't either, since it was full of code like this: #if !defined(__HUGS__) throwSocketErrorIfMinus1RetryMayBlock "recvFd" (threadWaitRead (fromIntegral fd)) $ #endif c_recvFd fd If __HUGS__ is defined, c_recvFd won't have its error code checked at all.
This fixes "no error" error messages on Windows when using these functions.
This does not change the external interface, except for making a few orphan instances available in Network.Socket.Internal that weren't before (e.g. Num instances for PortNumber).
We're using blocking FFI calls on Windows (unfortunately). If the server is unresponsive, connect() blocks for a while. An unsafe FFI call blocks the whole RTS, whereas a safe FFI call only blocks the current thread (when -threaded is used). Fixes #61