summaryrefslogtreecommitdiff
path: root/indra/llmessage/net.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/net.cpp')
-rw-r--r--indra/llmessage/net.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp
index 9e83ce1434..8cd7180f9a 100644
--- a/indra/llmessage/net.cpp
+++ b/indra/llmessage/net.cpp
@@ -269,8 +269,12 @@ S32 start_net(S32& socket_out, int& nPort)
return 0;
}
-void end_net()
+void end_net(S32& socket_out)
{
+ if (socket_out < 0)
+ {
+ closesocket(socket_out);
+ }
WSACleanup();
}
@@ -437,8 +441,12 @@ S32 start_net(S32& socket_out, int& nPort)
return 0;
}
-void end_net()
+void end_net(S32& socket_out)
{
+ if (socket_out < 0)
+ {
+ close(socket_out);
+ }
}
int receive_packet(int hSocket, char * receiveBuffer)