void gClient_ClientDisconnectHandler(ClientBase client) { GameClient gClient = client as GameClient; gClient.ClientDisconnectHandler -= new ClientBase.ClientDisconnectedDelegate(gClient_ClientDisconnectHandler); ClientMgr.RemoveClient(gClient); if (gClient.Socket != null) { byte[] temp = gClient.Socket.SendBuffer; gClient.Socket.SendBuffer = null; BufferMgr.ReleaseBuffer(temp); temp = gClient.Socket.ReceiveBuffer; gClient.Socket.ReceiveBuffer = null; BufferMgr.ReleaseBuffer(temp); } }
private void cClient_ClientDisconnectHandler(ClientBase client) { ServerClient sClient = client as ServerClient; sClient.ClientDisconnectHandler -= new ClientBase.ClientDisconnectedDelegate(cClient_ClientDisconnectHandler); GameServerMgr.RemoveClient(sClient); if (sClient.Socket != null) { byte[] temp = sClient.Socket.SendBuffer; sClient.Socket.SendBuffer = null; BufferMgr.ReleaseBuffer(temp); temp = sClient.Socket.ReceiveBuffer; sClient.Socket.ReceiveBuffer = null; BufferMgr.ReleaseBuffer(temp); } }
protected virtual void OnDisconnected() { BufferMgr.ReleaseBuffer(sBuffer); BufferMgr.ReleaseBuffer(rBuffer); }