示例#1
0
 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();
     }
 }
示例#3
0
 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();
     }
 }