本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}