public AsyncTCPListener(WebListenerConfig config) { this.mConfig = config; Init(); }
private void Init() { try { mWebHandlers = new List<IWebListeningHandler>(); mClientHandler = new Dictionary<string, IWebListeningHandler>(); mClientSockArg = new Dictionary<string, SocketAsyncEventArgs>(); if (null == mConfig) { mConfig = new WebListenerConfig(); } mBufManager = new BufferPoolManager(mConfig.MaxBufferSize, mConfig.MaxConnection); mEventArgsPool = new EventArgsPoolManager(mConfig.MaxConnection); mIOCompletedEvent = new EventHandler<SocketAsyncEventArgs>(IOCompleted); } catch(Exception e) { throw new WebListenerException("Error occurred during initialization: " + e.ToString()); } }