Example #1
0
        public TcpServerChannel()
        {
            this.socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
            {
                Blocking = false,
                NoDelay  = true
            };

            this.config = new AcceptConfig();

            this.semaphore = new Semaphore(config.MaxConcurrentNumber, config.MaxConcurrentNumber);
        }
Example #2
0
 /// <summary>
 /// 设置配置信息
 /// </summary>
 /// <param name="config"></param>
 public void SetConfig(AcceptConfig config)
 {
     this.config = config;
 }