You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I think there is a bug in the above line. This does not work. The return value is -1. I guess because you've previously enabled address re-use. Just applying SO_EXCLUSIVEADDRUSE (without SO_REUSEADDR) works.
I mean ... what is the purpose at all? In the Linux path you enable address/port re-usage. And in the Win32 path you try to disable it by acquiring the port exclusively? Currently it's enabled for both platforms, because SO_EXCLUSIVEADDRUSE fails. I stumbled over this because for my project this behaviour was kind of unexpected. My expectation was that a port can only be bound by one application/process/thread.
The text was updated successfully, but these errors were encountered:
@Frank-Friemel sorry for the delay. As you mentioned, there is inconsistency between the Windows implementation and others (Linux and macOS). I actually prefer 'address/port re-usage' over 'exclusive address usage'. As for Windows, it seems I misunderstood the WinSock spec. (#506 (comment))
So in order to make all the platform behaviors consistent, I am actually removing SO_EXCLUSIVEADDRUSE from the Windows implementation.
If you would like to have 'exclusive address usage', you can set the socket option to SO_EXCLUSIVEADDRUSE with Server::set_socket_options.
cpp-httplib/httplib.h
Line 2044 in d647f48
Hi, I think there is a bug in the above line. This does not work. The return value is -1. I guess because you've previously enabled address re-use. Just applying SO_EXCLUSIVEADDRUSE (without SO_REUSEADDR) works.
I mean ... what is the purpose at all? In the Linux path you enable address/port re-usage. And in the Win32 path you try to disable it by acquiring the port exclusively? Currently it's enabled for both platforms, because SO_EXCLUSIVEADDRUSE fails. I stumbled over this because for my project this behaviour was kind of unexpected. My expectation was that a port can only be bound by one application/process/thread.
The text was updated successfully, but these errors were encountered: