(svn r1483) -Fix: don't close a socket if it is already closed (windows doesn't like

it :() (partly tnx to tamlin)
This commit is contained in:
truelight
2005-01-11 15:52:18 +00:00
parent 1feae2083d
commit 4873c0b1ea

View File

@@ -368,17 +368,23 @@ void NetworkUDPClose(void)
DEBUG(net, 1) ("[NET][UDP] Closed listeners");
if (_network_udp_server) {
closesocket(_udp_server_socket);
_udp_server_socket = INVALID_SOCKET;
if (_udp_server_socket != INVALID_SOCKET) {
closesocket(_udp_server_socket);
_udp_server_socket = INVALID_SOCKET;
}
closesocket(_udp_master_socket);
_udp_master_socket = INVALID_SOCKET;
if (_udp_master_socket != INVALID_SOCKET) {
closesocket(_udp_master_socket);
_udp_master_socket = INVALID_SOCKET;
}
_network_udp_server = false;
_network_udp_broadcast = 0;
} else {
closesocket(_udp_client_socket);
_udp_client_socket = INVALID_SOCKET;
if (_udp_client_socket != INVALID_SOCKET) {
closesocket(_udp_client_socket);
_udp_client_socket = INVALID_SOCKET;
}
_network_udp_broadcast = 0;
}
}