public TcpChannel(EndPoint endpoint, IPool <byte[]> buffers, IPool <SocketAsyncEventArgs> arguments, int listenBacklog, AddressFamily addressFamily, ITcpReceiver <byte[]> child) : base(buffers, arguments, addressFamily) { if (listenBacklog < 0) { throw new ArgumentException("Argument " + nameof(listenBacklog) + " must not be negative."); } EndPoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint)); _child = child ?? throw new ArgumentNullException(nameof(child)); Bind(endpoint, listenBacklog); }
private ITcpReceiver GetTcpReceiver(int identifier, int bufferLength, char endOfLine, SynchronizationContext synchronizationContext, Action <object, int, SynchronizationContext, string> onDataItemReceived, Action <object, byte[], int> onDataReceived) { ITcpReceiver tcpReceiver = default; try { tcpReceiver = _getTcpReceiver(this, identifier, bufferLength, endOfLine, synchronizationContext, onDataItemReceived, onDataReceived); } catch (Exception exception) { if (!Disconnecting) { throw new TcpIpReceiverDelegateFailedException(exception); } } return(tcpReceiver); }
public TcpDecodingReceiver(ITcpReceiver <string> child, System.Text.Encoding encoding) : base(child, encoding) { _child = child ?? throw new ArgumentNullException(nameof(child)); }
public TcpChannel(EndPoint endpoint, int buffers, int bufferSize, int eventArgs, int listenBacklog, AddressFamily addressFamily, ITcpReceiver <byte[]> child) : this(endpoint, new ByteArrayPool(buffers, bufferSize), new SocketAsyncEventArgsPool(eventArgs), listenBacklog, addressFamily, child) { }
public TcpDispatchingReceiver(ITcpReceiver <TForward> child, IDispatcher dispatcher) : base(child, dispatcher) { _dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher)); _child = child ?? throw new ArgumentNullException(nameof(child)); }
public TcpForwardingReceiver(ITcpReceiver <TOutput> child) : base(child) { }