mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-30 13:13:44 +00:00
Update server.c
Fix multi addr bind: example ./ss-server -s 0 -s :: 2015-01-21 07:28:09 ERROR: bind: Address already in use 2015-01-21 07:28:09 ERROR: Could not bind 2015-01-21 07:28:09 ERROR: bind() error
This commit is contained in:
@@ -167,6 +167,9 @@ int create_and_bind(const char *host, const char *port)
|
||||
}
|
||||
|
||||
int opt = 1;
|
||||
|
||||
setsockopt(listen_sock, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt));
|
||||
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
|
||||
#ifdef SO_NOSIGPIPE
|
||||
setsockopt(listen_sock, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
|
||||
|
||||
Reference in New Issue
Block a user