From f2b284b506e8f29cd17a9a75f88d53d7b58f3465 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 12 Jul 2003 03:15:47 +0000 Subject: [PATCH] Set SO_REUSEADDR in OS_bind_tcp_server_socket. --- v7/src/microcode/ntsock.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/v7/src/microcode/ntsock.c b/v7/src/microcode/ntsock.c index 6d93fa4e4..b64740dc9 100644 --- a/v7/src/microcode/ntsock.c +++ b/v7/src/microcode/ntsock.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: ntsock.c,v 1.16 2003/03/29 05:35:55 cph Exp $ +$Id: ntsock.c,v 1.17 2003/07/12 03:15:47 cph Exp $ Copyright 1997,1998,1999,2001,2002,2003 Massachusetts Institute of Technology @@ -201,10 +201,19 @@ void OS_bind_tcp_server_socket (Tchannel channel, void * host, unsigned int port) { struct sockaddr_in address; + BOOL one = 1; + memset ((&address), 0, (sizeof (address))); (address . sin_family) = AF_INET; memcpy ((& (address . sin_addr)), host, (sizeof (address . sin_addr))); (address . sin_port) = port; + + VOID_SOCKET_CALL + (setsockopt, ((CHANNEL_SOCKET (channel)), + SOL_SOCKET, + SO_REUSEADDR, + (&one), + (sizeof (one)))); VOID_SOCKET_CALL (bind, ((CHANNEL_SOCKET (channel)), ((struct sockaddr *) (&address)), @@ -212,7 +221,7 @@ OS_bind_tcp_server_socket (Tchannel channel, void * host, unsigned int port) } #ifndef SOCKET_LISTEN_BACKLOG -#define SOCKET_LISTEN_BACKLOG 5 +# define SOCKET_LISTEN_BACKLOG 5 #endif void -- 2.25.1