コード例 #1
0
 private void Clients_OnClientRemoved(object sender, TcpSocketListener.TcpClientsEventArgs e)
 {
     lock (this._receiveBufferLock)
     {
         if (this._lockCount > 0)
         {
             _pendingRemoveBuffers.Add(e.ReceiveBuffer);
         }
         else
         {
             _receiveBuffers.Remove(e.ReceiveBuffer);
         }
     }
 }
コード例 #2
0
        private void Clients_OnClientAdded(object sender, TcpSocketListener.TcpClientsEventArgs e)
        {
            lock (this._receiveBufferLock)
            {
                if (this._lockCount > 0)
                {
                    _pendingAddBuffers.Add(e.ReceiveBuffer);
                }
                else
                {
                    _receiveBuffers.Add(e.ReceiveBuffer);

                    e.ReceiveBuffer.OnWriteComplete = OnBeforeWriteComplete;
                }
            }
        }