Closed fpagliughi closed 4 years ago
Not in the same way, I think. It does support read and write timeouts but they are set per socket (i.e. setsockopt
) while it looks like this is being set globally.
Oh, sorry that code snippet is a bit misleading. The set_option()
call is a socket
member function, so it changes the timeout for the specific socket.
It just calls the OS setsockopt()
. Does Windows support that? Looks like maybe. So perhaps I remove the conditional compilation and it works. I'll try that when I dust off the Windows laptop.
Yes, setsockopt
is a part of the WSA API.
Yes, the same call... except that Windows uses a different data type for the parameter! (DWORD milliseconds instead of timeval). OMG. Windows.
In the
stream_socket
class, the calls toread_timeout()
andwrite_timeout()
are empty for Windows. I can't remember if Windows doesn't support this, or if I was just too lazy to look up how.@borrrden Do you know?