Conversation
| -- | ||
| -- Currently, the 'recv' family is blocked on Windows because a proper | ||
| -- IO manager is not implemented. To use with 'System.Timeout.timeout' | ||
| -- on Windows, use 'Network.Socket.setSocketOption' with |
There was a problem hiding this comment.
Just a remark. We had problems with using System.Timeout.timeout on Windows, exactly because the lack of proper IO manager. On Windows the implementation is inefficient (relays on GHC scheduler, needs to create threads), and thus it can be too slow for network applications.
There was a problem hiding this comment.
FYI: @Mistuke is preparing a new IO manager for Windows.
There was a problem hiding this comment.
I know, in the mean time (since 4 years 😁) we use (for other reasons) https://github.com/input-output-hk/Win32-network
There was a problem hiding this comment.
Network should be easy to convert, that is, do a 1-1 conversion. Despite the name FD network has always used native Socket handles, but the big issue is that it's of the wrong time, so it gets truncated. This is "safe" as long as you don't use enough sockets to hit the truncation mark. So the socket handle type in Network needs to be a struct so we can use FDs (int) on Unix but long long (pointers) on Windows.
After that the conversion should be very straight forward. Unfortunately my day job leaves me with a lot less time to work on Haskell in my free time. If you'd be willing to do the type conversion @coot we can move this along a bit.
|
Relating to #543. |
|
@Mistuke Do you agree with this PR itself? |
|
@kazu-yamamoto yes sorry, was double checking the ranges of the types. Yeah this looks good to me. |
|
@Mistuke Thank you! |
This implements
SO_SNDTIMEOandSO_RCVTIMEO.This patch is small, so you can understand my intention very easily, I guess.
Please skip the style-only commit and review the last two commits.