Esempio n. 1
0
        private void init(string hostname, System.Net.IPAddress address, int port, bool secure, LogLevel trace)
        {
            _hostname = hostname ?? convertToString(address);
            _address  = address;
            _port     = port;
            _secure   = secure;

            _listener = new HttpListener(trace);
            _listener.Prefixes.Add(
                String.Format("http{0}://{1}:{2}/", secure ? "s" : "", _hostname, port));

            _logger   = _listener.Log;
            _services = new WebSocketServiceManager(_logger);
            _sync     = new object();

            var os = Environment.OSVersion;

            _windows = os.Platform != PlatformID.Unix && os.Platform != PlatformID.MacOSX;
        }