/// <summary> /// </summary> /// <param name="configuration"></param> public ChannelTcpListener(ChannelTcpListenerConfiguration configuration) { if (configuration == null) throw new ArgumentNullException("configuration"); Configure(configuration); ChannelFactory = new TcpChannelFactory(); }
/// <summary> /// Initializes a new instance of the <see cref="HttpServer" /> class. /// </summary> /// <param name="moduleManager">The modules are used to process the HTTP requests. You need to specify at least one.</param> public HttpServer(IModuleManager moduleManager) { _moduleManager = moduleManager; BodyDecoder = new CompositeIMessageSerializer(); _configuration = new ChannelTcpListenerConfiguration(() => new HttpMessageDecoder(BodyDecoder), () => new HttpMessageEncoder()); _bufferSlicePool = new BufferSlicePool(65535, 100); ApplicationInfo = new MemoryItemStorage(); }
/// <summary> /// </summary> /// <param name="configuration"></param> public ChannelTcpListener(ChannelTcpListenerConfiguration configuration) { if (configuration == null) { throw new ArgumentNullException("configuration"); } Configure(configuration); ChannelFactory = new TcpChannelFactory(); }
/// <summary> /// Initializes a new instance of the <see cref="HttpServer" /> class. /// </summary> /// <param name="moduleManager">The modules are used to process the HTTP requests. You need to specify at least one.</param> /// <param name="configuration"> /// You can override the configuration to your likings. /// </param> /// <exception cref="System.ArgumentNullException">moduleManager/configuration</exception> public HttpServer(IModuleManager moduleManager, ChannelTcpListenerConfiguration configuration) { if (moduleManager == null) throw new ArgumentNullException("moduleManager"); if (configuration == null) throw new ArgumentNullException("configuration"); BodyDecoder = new CompositeIMessageSerializer(); _moduleManager = moduleManager; _configuration = configuration; _bufferSlicePool = new BufferSlicePool(65535, 100); ApplicationInfo = new MemoryItemStorage(); }
/// <summary> /// </summary> /// <param name="configuration"></param> public ChannelTcpListener(ChannelTcpListenerConfiguration configuration) { if (configuration == null) { throw new ArgumentNullException("configuration"); } this.Configure(configuration); this.ChannelFactory = new TcpChannelFactory(); this.listenerArgs = new SocketAsyncEventArgs(); this.listenerArgs.Completed += this.OnAcceptSocket; }
/// <summary> /// To allow the sub classes to configure this class in their constructors. /// </summary> /// <param name="configuration"></param> protected void Configure(ChannelTcpListenerConfiguration configuration) { _bufferPool = configuration.BufferPool; _configuration = configuration; }
/// <summary> /// To allow the sub classes to configure this class in their constructors. /// </summary> /// <param name="configuration"></param> protected void Configure(ChannelTcpListenerConfiguration configuration) { this._bufferPool = configuration.BufferPool; this._configuration = configuration; }