예제 #1
0
 public AsyncTCPListener(WebListenerConfig config)
 {
     this.mConfig = config;
       Init();
 }
예제 #2
0
        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());
              }
        }