public AsyncTcpServer( IPAddress listenedAddress, int listenedPort, Func <AsyncTcpServerSession, byte[], int, int, Task> onSessionDataReceived = null, Func <AsyncTcpServerSession, Task> onSessionStarted = null, Func <AsyncTcpServerSession, Task> onSessionClosed = null, AsyncTcpServerConfiguration configuration = null) : this(new IPEndPoint(listenedAddress, listenedPort), onSessionDataReceived, onSessionStarted, onSessionClosed, configuration) { }
public AsyncTcpServer( IPEndPoint listenedEndPoint, Func <AsyncTcpServerSession, byte[], int, int, Task> onSessionDataReceived = null, Func <AsyncTcpServerSession, Task> onSessionStarted = null, Func <AsyncTcpServerSession, Task> onSessionClosed = null, AsyncTcpServerConfiguration configuration = null) : this(listenedEndPoint, new AsyncTcpServerEventDispatcher(onSessionDataReceived, onSessionStarted, onSessionClosed), configuration) { }
public AsyncTcpServer(IPEndPoint listenedEndPoint, IAsyncTcpServerEventDispatcher dispatcher, AsyncTcpServerConfiguration configuration = null) { if (listenedEndPoint == null) { throw new ArgumentNullException("listenedEndPoint"); } if (dispatcher == null) { throw new ArgumentNullException("dispatcher"); } this.ListenedEndPoint = listenedEndPoint; _dispatcher = dispatcher; _configuration = configuration ?? new AsyncTcpServerConfiguration(); if (_configuration.BufferManager == null) { throw new InvalidProgramException("The buffer manager in configuration cannot be null."); } if (_configuration.FrameBuilder == null) { throw new InvalidProgramException("The frame handler in configuration cannot be null."); } }
public AsyncTcpServer(IPAddress listenedAddress, int listenedPort, IAsyncTcpServerEventDispatcher dispatcher, AsyncTcpServerConfiguration configuration = null) : this(new IPEndPoint(listenedAddress, listenedPort), dispatcher, configuration) { }
public AsyncTcpServer(int listenedPort, IAsyncTcpServerEventDispatcher dispatcher, AsyncTcpServerConfiguration configuration = null) : this(IPAddress.Any, listenedPort, dispatcher, configuration) { }