minor: provide user feedback in the log for now when udp in/out bound threads are started/stopped

cpu-performance
Justin Clark-Casey (justincc) 2013-07-18 22:54:10 +01:00
parent cbb47f8489
commit 5cdc21aac7
1 changed files with 8 additions and 4 deletions

View File

@ -111,6 +111,8 @@ namespace OpenMetaverse
if (!IsRunningInbound) if (!IsRunningInbound)
{ {
m_log.DebugFormat("[UDPBASE]: Starting inbound UDP loop");
const int SIO_UDP_CONNRESET = -1744830452; const int SIO_UDP_CONNRESET = -1744830452;
IPEndPoint ipep = new IPEndPoint(m_localBindAddress, m_udpPort); IPEndPoint ipep = new IPEndPoint(m_localBindAddress, m_udpPort);
@ -155,6 +157,8 @@ namespace OpenMetaverse
/// </summary> /// </summary>
public void StartOutbound() public void StartOutbound()
{ {
m_log.DebugFormat("[UDPBASE]: Starting outbound UDP loop");
IsRunningOutbound = true; IsRunningOutbound = true;
} }
@ -162,10 +166,8 @@ namespace OpenMetaverse
{ {
if (IsRunningInbound) if (IsRunningInbound)
{ {
// wait indefinitely for a writer lock. Once this is called, the .NET runtime m_log.DebugFormat("[UDPBASE]: Stopping inbound UDP loop");
// will deny any more reader locks, in effect blocking all other send/receive
// threads. Once we have the lock, we set IsRunningInbound = false to inform the other
// threads that the socket is closed.
IsRunningInbound = false; IsRunningInbound = false;
m_udpSocket.Close(); m_udpSocket.Close();
} }
@ -173,6 +175,8 @@ namespace OpenMetaverse
public void StopOutbound() public void StopOutbound()
{ {
m_log.DebugFormat("[UDPBASE]: Stopping outbound UDP loop");
IsRunningOutbound = false; IsRunningOutbound = false;
} }