public TcpSocketRioSession( TcpSocketRioServerConfiguration configuration, IBufferManager bufferManager, RioConnectionOrientedSocket socket, ITcpSocketRioServerMessageDispatcher dispatcher, TcpSocketRioServer server) { if (configuration == null) throw new ArgumentNullException("configuration"); if (bufferManager == null) throw new ArgumentNullException("bufferManager"); if (socket == null) throw new ArgumentNullException("socket"); if (dispatcher == null) throw new ArgumentNullException("dispatcher"); if (server == null) throw new ArgumentNullException("server"); _configuration = configuration; _bufferManager = bufferManager; _socket = socket; _dispatcher = dispatcher; _server = server; _sessionKey = Guid.NewGuid().ToString(); this.StartTime = DateTime.UtcNow; _receiveBuffer = _bufferManager.BorrowBuffer(); _sessionBuffer = _bufferManager.BorrowBuffer(); _sessionBufferCount = 0; _stream = new RioStream(_socket); }
public TcpSocketRioServer(IPEndPoint listenedEndPoint, ITcpSocketRioServerMessageDispatcher dispatcher, TcpSocketRioServerConfiguration configuration = null) { if (listenedEndPoint == null) { throw new ArgumentNullException("listenedEndPoint"); } if (dispatcher == null) { throw new ArgumentNullException("dispatcher"); } this.ListenedEndPoint = listenedEndPoint; _dispatcher = dispatcher; _configuration = configuration ?? new TcpSocketRioServerConfiguration(); 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."); } Initialize(); }
public TcpSocketRioServer(IPEndPoint listenedEndPoint, ITcpSocketRioServerMessageDispatcher dispatcher, TcpSocketRioServerConfiguration configuration = null) { if (listenedEndPoint == null) throw new ArgumentNullException("listenedEndPoint"); if (dispatcher == null) throw new ArgumentNullException("dispatcher"); this.ListenedEndPoint = listenedEndPoint; _dispatcher = dispatcher; _configuration = configuration ?? new TcpSocketRioServerConfiguration(); if (_configuration.FrameBuilder == null) throw new InvalidProgramException("The frame handler in configuration cannot be null."); Initialize(); }
public TcpSocketRioSession( TcpSocketRioServerConfiguration configuration, ISegmentBufferManager bufferManager, RioSocket socket, ITcpSocketRioServerMessageDispatcher dispatcher, TcpSocketRioServer server) { if (configuration == null) { throw new ArgumentNullException("configuration"); } if (bufferManager == null) { throw new ArgumentNullException("bufferManager"); } if (socket == null) { throw new ArgumentNullException("socket"); } if (dispatcher == null) { throw new ArgumentNullException("dispatcher"); } if (server == null) { throw new ArgumentNullException("server"); } _configuration = configuration; _bufferManager = bufferManager; _socket = socket; _dispatcher = dispatcher; _server = server; _sessionKey = Guid.NewGuid().ToString(); this.StartTime = DateTime.UtcNow; if (_receiveBuffer == default(ArraySegment <byte>)) { _receiveBuffer = _bufferManager.BorrowBuffer(); } _receiveBufferOffset = 0; _stream = new RioStream(_socket); }
public TcpSocketRioSession( TcpSocketRioServerConfiguration configuration, IBufferManager bufferManager, RioConnectionOrientedSocket socket, ITcpSocketRioServerMessageDispatcher dispatcher, TcpSocketRioServer server) { if (configuration == null) { throw new ArgumentNullException("configuration"); } if (bufferManager == null) { throw new ArgumentNullException("bufferManager"); } if (socket == null) { throw new ArgumentNullException("socket"); } if (dispatcher == null) { throw new ArgumentNullException("dispatcher"); } if (server == null) { throw new ArgumentNullException("server"); } _configuration = configuration; _bufferManager = bufferManager; _socket = socket; _dispatcher = dispatcher; _server = server; _sessionKey = Guid.NewGuid().ToString(); this.StartTime = DateTime.UtcNow; _receiveBuffer = _bufferManager.BorrowBuffer(); _sessionBuffer = _bufferManager.BorrowBuffer(); _sessionBufferCount = 0; _stream = new RioStream(_socket); }
public TcpSocketRioServer(IPAddress listenedAddress, int listenedPort, ITcpSocketRioServerMessageDispatcher dispatcher, TcpSocketRioServerConfiguration configuration = null) : this(new IPEndPoint(listenedAddress, listenedPort), dispatcher, configuration) { }
public TcpSocketRioServer(int listenedPort, ITcpSocketRioServerMessageDispatcher dispatcher, TcpSocketRioServerConfiguration configuration = null) : this(IPAddress.Any, listenedPort, dispatcher, configuration) { }
public TcpSocketRioServer(IPAddress listenedAddress, int listenedPort, ITcpSocketRioServerMessageDispatcher dispatcher, TcpSocketRioServerConfiguration configuration = null) : this(new IPEndPoint(listenedAddress, listenedPort), dispatcher, configuration) { }
public TcpSocketRioServer(int listenedPort, ITcpSocketRioServerMessageDispatcher dispatcher, TcpSocketRioServerConfiguration configuration = null) : this(IPAddress.Any, listenedPort, dispatcher, configuration) { }