mirror of
https://github.com/0intro/libtask
synced 2024-12-22 19:16:55 +03:00
initialize socklen
This commit is contained in:
parent
ef218ac4d8
commit
cf7e56655b
1
net.c
1
net.c
@ -59,6 +59,7 @@ netannounce(int istcp, char *server, int port)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set reuse flag for tcp */
|
/* set reuse flag for tcp */
|
||||||
|
sn = sizeof n;
|
||||||
if(istcp && getsockopt(fd, SOL_SOCKET, SO_TYPE, (void*)&n, &sn) >= 0){
|
if(istcp && getsockopt(fd, SOL_SOCKET, SO_TYPE, (void*)&n, &sn) >= 0){
|
||||||
n = 1;
|
n = 1;
|
||||||
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&n, sizeof n);
|
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&n, sizeof n);
|
||||||
|
Loading…
Reference in New Issue
Block a user