本文整理匯總了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);
}
}