Merge pull request #624 from slomp/slomp/udp-broadcast-fix

Fixes around UDP broadcast
This commit is contained in:
Bartosz Taudul 2023-09-21 20:29:32 +02:00 committed by GitHub
commit 60a3a85069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -678,10 +678,10 @@ bool UdpListen::Listen( uint16_t port )
#endif
#if defined _WIN32
unsigned long reuse = 1;
setsockopt( m_sock, SOL_SOCKET, SO_REUSEADDR, (const char*)&reuse, sizeof( reuse ) );
setsockopt( sock, SOL_SOCKET, SO_REUSEADDR, (const char*)&reuse, sizeof( reuse ) );
#else
int reuse = 1;
setsockopt( m_sock, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof( reuse ) );
setsockopt( sock, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof( reuse ) );
#endif
#if defined _WIN32
unsigned long broadcast = 1;