projects
/
gapil.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Risistemate le trattazioni delle opzioni SO_KEEPALIVE e SO_REUSEADDR, con
[gapil.git]
/
sources
/
SockUtil.c
diff --git
a/sources/SockUtil.c
b/sources/SockUtil.c
index 28b22defae96326ad406f723a85bea0484316bb2..8b3fef219143d48543cb0e2dd49b79651efb8840 100644
(file)
--- a/
sources/SockUtil.c
+++ b/
sources/SockUtil.c
@@
-205,12
+205,11
@@
int sockbind(char *host, char *serv, int prot, int type)
* $Id$
*
****************************************************************/
* $Id$
*
****************************************************************/
-int sockbind
2(char *host, char *serv, int prot, int typ
e)
+int sockbind
opt(char *host, char *serv, int prot, int type, int reus
e)
{
struct addrinfo hint, *addr, *save;
int res;
int sock;
{
struct addrinfo hint, *addr, *save;
int res;
int sock;
- int opt=1;
char buf[INET6_ADDRSTRLEN];
/* initialize hint structure */
memset(&hint, 0, sizeof(struct addrinfo));
char buf[INET6_ADDRSTRLEN];
/* initialize hint structure */
memset(&hint, 0, sizeof(struct addrinfo));
@@
-240,7
+239,8
@@
int sockbind2(char *host, char *serv, int prot, int type)
}
}
/* connect the socket */
}
}
/* connect the socket */
- if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt))) {
+ if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
+ &reuse, sizeof(reuse))) {
printf("error on socket options\n");
return -1;
}
printf("error on socket options\n");
return -1;
}