You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-16 23:26:32 +09:00
initializing network (including binding to socket) moved out from network thread, enabling catching of exceptions
ConnectionReset on reading handled properly (by disconnecting) when only one connection readonly added to various members
This commit is contained in:
@@ -64,6 +64,8 @@ namespace Lidgren.Network
|
||||
{
|
||||
LogWarning("Pending connection still in pending state after 10 seconds; forgot to Approve/Deny?");
|
||||
m_pendingConnections.Remove(conn);
|
||||
if (m_pendingConnections.Count < 1)
|
||||
m_pendingConnections = null;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -71,12 +73,16 @@ namespace Lidgren.Network
|
||||
// accept connection
|
||||
AcceptConnection(conn);
|
||||
m_pendingConnections.Remove(conn);
|
||||
if (m_pendingConnections.Count < 1)
|
||||
m_pendingConnections = null;
|
||||
return;
|
||||
case PendingConnectionStatus.Denied:
|
||||
// send disconnected
|
||||
NetOutgoingMessage bye = CreateLibraryMessage(NetMessageLibraryType.Disconnect, conn.m_pendingDenialReason);
|
||||
SendUnconnectedLibrary(bye, conn.m_remoteEndpoint);
|
||||
m_pendingConnections.Remove(conn);
|
||||
if (m_pendingConnections.Count < 1)
|
||||
m_pendingConnections = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user