diff options
Diffstat (limited to 'src/net')
| -rwxr-xr-x | src/net/tcp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/net/tcp.c b/src/net/tcp.c index 0d5d03c..766fdbe 100755 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -41,6 +41,7 @@ void destroySockTcp(sock_tcp_t *p) sock_tcp_t* bindTcpSocket(char *address, int port, int proto) { sock_tcp_t *new; + unsigned long param_setsock = 1; int len; int ret; @@ -70,6 +71,8 @@ sock_tcp_t* bindTcpSocket(char *address, int port, int proto) return NULL; } + setsockopt(new->sock, SOL_SOCKET, SO_REUSEADDR, (char *) ¶m_setsock, sizeof (param_setsock)); + if( new->proto == PROTO_TCPv4 ) { new->sockAddr.sin_family = AF_INET; |