コード例 #1
0
        private void OnWriteComplete(IAsyncResult result)
        {
            StreamAsyncState streamAsyncState = result.AsyncState as StreamAsyncState;

            if (streamAsyncState == null || streamAsyncState.Stream == null)
            {
                OnError(new NullReferenceException("State of Ssl stream is null."));
                return;
            }
            AuthenticatedStream stream = streamAsyncState.Stream;

            try
            {
                stream.EndWrite(result);
            }
            catch (Exception e)
            {
                if (!IsIgnorableException(e))
                {
                    OnError(e);
                }
                if (EnsureSocketClosed(streamAsyncState.Client))
                {
                    OnClosed();
                }
                return;
            }
            PosList <ArraySegment <byte> > sendingItems = streamAsyncState.SendingItems;
            int num = sendingItems.Position + 1;

            if (num < sendingItems.Count)
            {
                sendingItems.Position = num;
                Sendpublic(sendingItems);
            }
            else
            {
                try
                {
                    m_Stream.Flush();
                }
                catch (Exception e2)
                {
                    if (!IsIgnorableException(e2))
                    {
                        OnError(e2);
                    }
                    if (EnsureSocketClosed(streamAsyncState.Client))
                    {
                        OnClosed();
                    }
                    return;
                }
                OnSendingCompleted();
            }
        }
コード例 #2
0
        // Token: 0x060008D0 RID: 2256 RVA: 0x0001E168 File Offset: 0x0001C368
        private void DequeueSend()
        {
            PosList <ArraySegment <byte> > sendingItems = this.GetSendingItems();

            if (!this.m_SendingQueue.TryDequeue(sendingItems))
            {
                this.m_IsSending = 0;
                return;
            }
            this.Sendpublic(sendingItems);
        }
コード例 #3
0
        private void DequeueSend()
        {
            PosList <ArraySegment <byte> > sendingItems = GetSendingItems();

            if (!m_SendingQueue.TryDequeue(sendingItems))
            {
                m_IsSending = 0;
            }
            else
            {
                Sendpublic(sendingItems);
            }
        }
コード例 #4
0
        // Token: 0x060008D2 RID: 2258 RVA: 0x0001E19C File Offset: 0x0001C39C
        protected void OnSendingCompleted()
        {
            PosList <ArraySegment <byte> > sendingItems = this.GetSendingItems();

            sendingItems.Clear();
            sendingItems.Position = 0;
            if (!this.m_SendingQueue.TryDequeue(sendingItems))
            {
                this.m_IsSending = 0;
                return;
            }
            this.Sendpublic(sendingItems);
        }
コード例 #5
0
        protected void OnSendingCompleted()
        {
            PosList <ArraySegment <byte> > sendingItems = GetSendingItems();

            sendingItems.Clear();
            sendingItems.Position = 0;
            if (!m_SendingQueue.TryDequeue(sendingItems))
            {
                m_IsSending = 0;
            }
            else
            {
                Sendpublic(sendingItems);
            }
        }
コード例 #6
0
 protected abstract void Sendpublic(PosList <ArraySegment <byte> > items);