Exemplo n.º 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);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 设置配置信息
 /// </summary>
 /// <param name="config"></param>
 public void SetConfig(AcceptConfig config)
 {
     this.config = config;
 }