mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-16 00:34:19 +00:00
Socket change to provide consistent re-use behaviour on posix and Windows.
This commit is contained in:
parent
a13eb80e6e
commit
91e6d9a35a
1 changed files with 2 additions and 0 deletions
|
|
@ -418,8 +418,10 @@ bool StreamingSocket::createListener (const int newPortNumber, const String& loc
|
|||
if (handle < 0)
|
||||
return false;
|
||||
|
||||
#if ! JUCE_WINDOWS // on windows, adding this option produces behaviour different to posix
|
||||
const int reuse = 1;
|
||||
setsockopt (handle, SOL_SOCKET, SO_REUSEADDR, (const char*) &reuse, sizeof (reuse));
|
||||
#endif
|
||||
|
||||
if (bind (handle, (struct sockaddr*) &servTmpAddr, sizeof (struct sockaddr_in)) < 0
|
||||
|| listen (handle, SOMAXCONN) < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue