当前位置: 首页>>代码示例>>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;未经允许,请勿转载。