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.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp
index a78b216ccb..9e83ce1434 100644
--- a/indra/llmessage/net.cpp
+++ b/indra/llmessage/net.cpp
@@ -222,6 +222,12 @@ S32 start_net(S32& socket_out, int& nPort)
return 4;
}
}
+
+ sockaddr_in socket_address;
+ S32 socket_address_size = sizeof(socket_address);
+ getsockname(hSocket, (SOCKADDR*) &socket_address, &socket_address_size);
+ attempt_port = ntohs(socket_address.sin_port);
+
llinfos << "connected on port " << attempt_port << llendl;
nPort = attempt_port;