|
@@ -331,7 +331,12 @@ bool CSATTCPServer::_InitializeListenSocket(unsigned int port)
|
|
|
|
|
|
ServerAddress.sin_addr.s_addr = htonl(INADDR_ANY);
|
|
|
|
|
|
- ServerAddress.sin_port = htons(port);
|
|
|
+ ServerAddress.sin_port = htons(port);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ BOOL bReuseaddr = TRUE;
|
|
|
+ setsockopt(m_pListenContext->m_Socket,SOL_SOCKET ,SO_REUSEADDR,(const char*)&bReuseaddr,sizeof(BOOL));
|
|
|
|
|
|
|
|
|
if (SOCKET_ERROR == ::bind(m_pListenContext->m_Socket, (struct sockaddr *) &ServerAddress, sizeof(ServerAddress)))
|