mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Bind on both IPv6 and IPv4 on BSD.
This commit is contained in:
parent
a9cd5b331f
commit
3282360382
@ -22,6 +22,7 @@
|
|||||||
#else
|
#else
|
||||||
# include <arpa/inet.h>
|
# include <arpa/inet.h>
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
|
# include <sys/param.h>
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
# include <netdb.h>
|
# include <netdb.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
@ -306,6 +307,9 @@ bool ListenSocket::Listen( int port, int backlog )
|
|||||||
#if defined _WIN32 || defined __CYGWIN__
|
#if defined _WIN32 || defined __CYGWIN__
|
||||||
unsigned long val = 0;
|
unsigned long val = 0;
|
||||||
setsockopt( m_sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&val, sizeof( val ) );
|
setsockopt( m_sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&val, sizeof( val ) );
|
||||||
|
#elif defined BSD
|
||||||
|
int val = 0;
|
||||||
|
setsockopt( m_sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&val, sizeof( val ) );
|
||||||
#else
|
#else
|
||||||
int val = 1;
|
int val = 1;
|
||||||
setsockopt( m_sock, SOL_SOCKET, SO_REUSEADDR, &val, sizeof( val ) );
|
setsockopt( m_sock, SOL_SOCKET, SO_REUSEADDR, &val, sizeof( val ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user