public void Set(server server, int maxActiveSocketCount, int maxSocketCount) { this.server = server; this.maxActiveSocketCount = maxActiveSocketCount; this.maxSocketCount = maxSocketCount; nodeLock = new object(); nodes = new node[256]; ipv4Queue = dictionary.CreateInt <int>(); nodeIndex = 1; }
/// <summary> /// 开始处理新的请求 /// </summary> /// <param name="server">HTTP服务</param> /// <param name="socket">套接字</param> internal void Start(server server, Socket socket) { this.server = server; servers = server.Servers; Socket = socket; try { SslStream = new SslStream(networkStream = new NetworkStream(socket, true), false); SslStream.BeginAuthenticateAsServer(server.Certificate, false, server.Protocol, false, authenticateCallback, this); return; } catch (Exception error) { log.Default.Add(error, null, false); } headerError(); }