public WebSocketClient(Uri uri, WebSocketClientConfiguration configuration = null, Action<string> log = null) { if (uri == null) throw new ArgumentNullException("uri"); if (!Consts.WebSocketSchemes.Contains(uri.Scheme.ToLowerInvariant())) throw new NotSupportedException( string.Format("Not support the specified scheme [{0}].", uri.Scheme)); _uri = uri; _remoteEndPoint = ResolveRemoteEndPoint(_uri); _configuration = configuration != null ? configuration : new WebSocketClientConfiguration(); _log = log != null ? log : (s) => { }; _sslEnabled = uri.Scheme.ToLowerInvariant() == "wss"; Initialize(); }
public WebSocketClient(Uri uri, WebSocketClientConfiguration configuration = null, Action <string> log = null) { if (uri == null) { throw new ArgumentNullException("uri"); } if (!Consts.WebSocketSchemes.Contains(uri.Scheme.ToLowerInvariant())) { throw new NotSupportedException( string.Format("Not support the specified scheme [{0}].", uri.Scheme)); } _uri = uri; _remoteEndPoint = ResolveRemoteEndPoint(_uri); _configuration = configuration != null ? configuration : new WebSocketClientConfiguration(); _log = log != null ? log : (s) => { }; _sslEnabled = uri.Scheme.ToLowerInvariant() == "wss"; Initialize(); }