當前位置: 首頁>>代碼示例>>C#>>正文


C# IoBuffer.GetRemaining方法代碼示例

本文整理匯總了C#中Mina.Core.Buffer.IoBuffer.GetRemaining方法的典型用法代碼示例。如果您正苦於以下問題:C# IoBuffer.GetRemaining方法的具體用法?C# IoBuffer.GetRemaining怎麽用?C# IoBuffer.GetRemaining使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mina.Core.Buffer.IoBuffer的用法示例。


在下文中一共展示了IoBuffer.GetRemaining方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: BeginSend

 /// <inheritdoc/>
 protected override void BeginSend(IWriteRequest request, IoBuffer buf)
 {
     ArraySegment<Byte> array = buf.GetRemaining();
     try
     {
         Socket.BeginSend(array.Array, array.Offset, array.Count, SocketFlags.None, SendCallback, new SendingContext(Socket, buf));
     }
     catch (ObjectDisposedException)
     {
         // ignore
     }
     catch (Exception ex)
     {
         EndSend(ex);
     }
 }
開發者ID:ettele,項目名稱:Mina.NET,代碼行數:17,代碼來源:AsyncSocketSession.NET20.cs

示例2: BeginSend

 private void BeginSend(IoBuffer buf, EndPoint destination)
 {
     ArraySegment<Byte> array = buf.GetRemaining();
     try
     {
         Socket.BeginSendTo(array.Array, array.Offset, array.Count, SocketFlags.None, destination, SendCallback, new SendingContext(Socket, buf));
     }
     catch (ObjectDisposedException)
     {
         // ignore
     }
     catch (Exception ex)
     {
         EndSend(ex);
     }
 }
開發者ID:zhangf911,項目名稱:Mina.NET,代碼行數:16,代碼來源:AsyncDatagramSession.NET20.cs

示例3: BeginSend

 private void BeginSend(AsyncDatagramSession session, IoBuffer buf, EndPoint remoteEP)
 {
     ArraySegment<Byte> array = buf.GetRemaining();
     try
     {
         Socket.BeginSendTo(array.Array, array.Offset, array.Count, SocketFlags.None, remoteEP, SendCallback, session);
     }
     catch (ObjectDisposedException)
     {
         // ignore
     }
     catch (Exception ex)
     {
         EndSend(session, ex);
     }
 }
開發者ID:zhangf911,項目名稱:Mina.NET,代碼行數:16,代碼來源:AsyncDatagramAcceptor.NET20.cs

示例4: BeginSend

        private void BeginSend(IoBuffer buf)
        {
            ArraySegment<Byte> array = buf.GetRemaining();
            try
            {
                //make sync. add by zesus19
                _serialPort.Write(array.Array, array.Offset, array.Count);
                Int32 written = buf.Remaining;
                buf.Position += written;
                EndSend(written);

                //delete async
                //_serialPort.BaseStream.BeginWrite(array.Array, array.Offset, array.Count, SendCallback, buf);
            }
            catch (ObjectDisposedException)
            {
                // ignore
            }
            catch (Exception ex)
            {
                this.FilterChain.FireExceptionCaught(ex);
                //add by zesus19
                Processor.Remove(this);
            }
        }
開發者ID:zesus19,項目名稱:c5.v1,代碼行數:25,代碼來源:SerialSession.cs

示例5: PutInternal

 /// <inheritdoc/>
 protected override void PutInternal(IoBuffer src)
 {
     ArraySegment<Byte> array = src.GetRemaining();
     if (array.Count > Remaining)
         throw new OverflowException();
     PutInternal(array.Array, array.Offset, array.Count);
     src.Position += array.Count;
 }
開發者ID:zesus19,項目名稱:c5.v1,代碼行數:9,代碼來源:SocketAsyncEventArgsBuffer.cs

示例6: BeginSend

 private void BeginSend(IoBuffer buf)
 {
     ArraySegment<Byte> array = buf.GetRemaining();
     try
     {
         _serialPort.BaseStream.BeginWrite(array.Array, array.Offset, array.Count, SendCallback, buf);
     }
     catch (ObjectDisposedException)
     {
         // ignore
     }
     catch (Exception ex)
     {
         this.FilterChain.FireExceptionCaught(ex);
     }
 }
開發者ID:zhangf911,項目名稱:Mina.NET,代碼行數:16,代碼來源:SerialSession.cs


注:本文中的Mina.Core.Buffer.IoBuffer.GetRemaining方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。