Пример #1
0
 internal bool TryDequeueOrReset(out SocketAsyncResult result)
 {
     lock (socket)
     {
         if (sendQueue.TryDequeue(out result))
         {
             return(true);
         }
         else
         {
             Interlocked.Exchange(ref isInSending, 0);
         }
         return(false);
     }
 }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="skip"></param>
 public virtual void Reset(bool skip)
 {
     byteArrayForMessage = null;
     Array.Clear(byteArrayForPrefix, 0, byteArrayForPrefix.Length);
     messageBytesDone    = 0;
     prefixBytesDone     = 0;
     messageLength       = 0;
     byteArrayForPrefix2 = null;
     prefixBytesDone2    = 0;
     byteArrayMask       = null;
     maskBytesDone       = 0;
     HeadFrame           = null;
     AsyncResult         = null;
     if (skip)
     {
         bufferSkip = 0;
     }
 }
Пример #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="skip"></param>
 public virtual void Reset(bool skip)
 {
     byteArrayForMessage = null;
     Array.Clear(byteArrayForPrefix, 0, byteArrayForPrefix.Length);
     messageBytesDone = 0;
     prefixBytesDone = 0;
     messageLength = 0;
     byteArrayForPrefix2 = null;
     prefixBytesDone2 = 0;
     byteArrayMask = null;
     maskBytesDone = 0;
     HeadFrame = null;
     AsyncResult = null;
     if (skip)
     {
         bufferSkip = 0;
     }
 }
Пример #4
0
        /// <summary>
        /// Send data success
        /// </summary>
        /// <param name="result"></param>
        protected virtual void OnSendCompleted(SocketAsyncResult result)
        {

        }
Пример #5
0
 internal bool TryDequeue(out SocketAsyncResult result)
 {
     return(sendQueue.TryDequeue(out result));
 }