public void Close(AsyncSocketState state) { if (state != null && (!disposedValue)) { LogTool.Log("客户端已关闭"); state.Datagram = ""; //TODO 触发关闭事件 state.Close(); } }
private void Close(AsyncSocketState state) { if (state != null && state.isRunning) { LogTool.Log("客户端已关闭"); state.Datagram = ""; state.isRunning = false; //TODO 触发关闭事件 state.Close(); } }
public void Close(AsyncSocketState state) { if (state != null && !disposed) { if (clientDic.ContainsKey(state.ClientSocket.RemoteEndPoint)) { clientDic.Remove(state.ClientSocket.RemoteEndPoint); } state.Datagram = null; state.RecvDataBuffer = null; //TODO 触发关闭事件 state.Close(); } }