public WrxCommandClient( IPacketWriter <WrxPacket> requestWriter, IPacketReader <WrxPacket> responseReader, ArrayPool <byte> byteArrayPool, bool doNotDisposeRequestWriter = false, bool doNotDisposeResponseReader = false) { _requestWriter = AsyncDisposableArg.Create(requestWriter, doNotDisposeRequestWriter); _responseReader = AsyncDisposableArg.Create(responseReader, doNotDisposeResponseReader); _byteArrayPool = byteArrayPool; }
public WrxCommandServer( IPacketReader <WrxPacket> requestReader, IPacketWriter <WrxPacket> responseWriter, IAsyncWrxCommandHandler commandHandler, ArrayPool <byte> byteArrayPool, bool doNotDisposeRequestReader = false, bool doNotDisposeResponseWriter = false) { _requestReader = AsyncDisposableArg.Create(requestReader, doNotDisposeRequestReader); _responseWriter = AsyncDisposableArg.Create(responseWriter, doNotDisposeResponseWriter); _commandHandler = commandHandler; _byteArrayPool = byteArrayPool; _disposePacketCallback = state => { if (state is byte[] array) { _byteArrayPool.Return(array); } }; }
public SimpleSequentialStream(IAsyncEnumerator <AsyncDisposableArg <IAsyncSimpleStream <T> > > streams) : this(AsyncDisposableArg.Create(SimpleStreams.Empty <T>(), false), streams) { }
public SimpleSequentialStream(IAsyncEnumerable <AsyncDisposableArg <IAsyncSimpleStream <T> > > streams, CancellationToken cancellationToken = default) : this(AsyncDisposableArg.Create(SimpleStreams.Empty <T>(), false), streams, cancellationToken) { }
public SimpleSequentialStream(IAsyncEnumerable <IAsyncSimpleStream <T> > streams, bool doNotDisposeStreams = false, CancellationToken cancellationToken = default) : this(streams.Select(s => AsyncDisposableArg.Create(s, doNotDisposeStreams)), cancellationToken) { }
public SimpleSequentialStream(IEnumerable <IAsyncSimpleStream <T> > streams, bool doNotDisposeStreams = false) : this(streams.Select(s => AsyncDisposableArg.Create(s, doNotDisposeStreams))) { }
public SimpleSequentialStream(params IAsyncSimpleStream <T>[] streams) : this(streams.Select(s => AsyncDisposableArg.Create(s, false))) { }