2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 13:33:13 +00:00
This commit is contained in:
2022-08-30 23:42:38 +03:00
parent 216b891bf8
commit 2cf0d59e6b
2 changed files with 11 additions and 13 deletions

View File

@ -220,17 +220,13 @@ public abstract class NetworkServer<TConnection> : IDestructible where TConnecti
public virtual void Remove(TConnection connection)
{
//connection.OnDataReceived -= OnDataReceived;
//connection.OnConnect -= OnClientConnect;
connection.OnClose -= ClientDisconnectedEventReceiver;
Connections.Remove(connection);
}
public virtual void Add(TConnection connection)
{
//connection.OnDataReceived += OnDataReceived;
//connection.OnConnect += OnClientConnect;
connection.OnClose += ClientDisconnectedEventReceiver;// OnClientClose;
connection.OnClose += ClientDisconnectedEventReceiver;
Connections.Add(connection);
}
@ -283,19 +279,12 @@ public abstract class NetworkServer<TConnection> : IDestructible where TConnecti
{
var con = connection as TConnection;
con.Destroy();
// con.OnClose -= ClientDisconnectedEventReceiver;
Remove(con);
//Connections.Remove(con);
ClientDisconnected(con);
//RemoveConnection((TConnection)sender);
//connections.Remove(sender)
//ClientDisconnected((TConnection)sender);
}
catch (Exception ex)
{
Global.Log("NetworkServer:OnClientDisconnect", LogType.Error, ex.ToString());
Global.Log(ex);
}
}