コード例 #1
0
ファイル: SerialSession.cs プロジェクト: zesus19/c5.v1
        private void BeginSend()
        {
            IWriteRequest req = CurrentWriteRequest;

            if (req == null)
            {
                req = WriteRequestQueue.Poll(this);

                if (req == null)
                {
                    Interlocked.Exchange(ref _writing, 0);
                    return;
                }
            }

            IoBuffer buf = req.Message as IoBuffer;

            if (buf == null)
            {
                throw new InvalidOperationException("Don't know how to handle message of type '"
                                                    + req.Message.GetType().Name + "'.  Are you missing a protocol encoder?");
            }
            else
            {
                CurrentWriteRequest = req;
                if (buf.HasRemaining)
                {
                    BeginSend(buf);
                }
                else
                {
                    EndSend(0);
                }
            }
        }
コード例 #2
0
 /// <inheritdoc/>
 public ICloseFuture CloseOnFlush()
 {
     if (!Closing)
     {
         WriteRequestQueue.Offer(this, CLOSE_REQUEST);
         Processor.Flush(this);
     }
     return(_closeFuture);
 }
コード例 #3
0
ファイル: AbstractIoSession.cs プロジェクト: xlg210/Mina.NET
 private ICloseFuture CloseOnFlush()
 {
     WriteRequestQueue.Offer(this, CLOSE_REQUEST);
     Processor.Flush(this);
     return(_closeFuture);
 }