public TcpServer(int localPort, bool bUseIPv6) { if (localPort < 1) throw new ArgumentException("localPort"); LocalPort = localPort; UseIPv6 = bUseIPv6; ConnectedSockets = new Dictionary<int, HttpSocket>(); InitListenFinished = new ManualResetEvent(false); ListenThreadSwitch = new ManualResetEvent(false); ListeningThread = null; }