public SocketIO(Uri uri) { if (uri.Scheme == "https" || uri.Scheme == "http" || uri.Scheme == "wss" || uri.Scheme == "ws") { _uri = uri; } else { throw new ArgumentException("Unsupported protocol"); } EventHandlers = new Dictionary <string, EventHandlerBox>(); Callbacks = new Dictionary <int, EventHandler>(); _urlConverter = new UrlConverter(); if (_uri.AbsolutePath != "/") { _namespace = _uri.AbsolutePath + ','; } _packetId = -1; ConnectTimeout = TimeSpan.FromSeconds(30); _pingSource = new CancellationTokenSource(); }