/// <summary>
 /// TCP 客户端套接字初始化处理
 /// </summary>
 /// <param name="socket"></param>
 private void onClientSocket(AutoCSer.Net.TcpServer.ClientSocketBase socket)
 {
     Abstract.QueueConsumerStreamProcessor oldProcesser = Processor;
     if (socket != null)
     {
         createProcessor();
     }
     else
     {
         Processor = null;
     }
     if (oldProcesser != null)
     {
         oldProcesser.Free();
     }
 }
示例#2
0
 /// <summary>
 /// 重启处理器
 /// </summary>
 /// <param name="processor"></param>
 internal void ReStartProcessor(QueueConsumerStreamProcessor processor)
 {
     if (IsProcessor(processor))
     {
         object setSocketLock = client._TcpClient_.SetSocketLock;
         Monitor.Enter(setSocketLock);
         try
         {
             if (IsProcessor(processor))
             {
                 Processor = null;
                 reStartProcessor();
             }
         }
         finally { Monitor.Exit(setSocketLock); }
     }
     processor.Free();
 }
示例#3
0
 internal bool IsProcessor(QueueConsumerStreamProcessor processor)
 {
     return(ReferenceEquals(Processor, processor) && isDisposed == 0);
 }