public WebSocketListener(IPEndPoint endpoint, WebSocketListenerOptions options) { Guard.ParameterCannotBeNull(endpoint, "endpoint"); Guard.ParameterCannotBeNull(options, "options"); options.CheckCoherence(); _options = options.Clone(); _cancel = new CancellationTokenSource(); #if NETSTANDARD || UAP _listener = new TcpListener(endpoint); #else if (Type.GetType("Mono.Runtime") == null && _options.UseDualStackSocket) _listener = TcpListener.Create(endpoint.Port); else _listener = new TcpListener(endpoint); #endif if (_options.UseNagleAlgorithm.HasValue) _listener.Server.NoDelay = !_options.UseNagleAlgorithm.Value; ConnectionExtensions = new WebSocketConnectionExtensionCollection(this); Standards = new WebSocketFactoryCollection(this); _negotiationQueue = new HttpNegotiationQueue(Standards, ConnectionExtensions, options); }
public WebSocketListener(IPEndPoint endpoint, WebSocketListenerOptions options) { Guard.ParameterCannotBeNull(endpoint, "endpoint"); Guard.ParameterCannotBeNull(options, "options"); options.CheckCoherence(); _options = options.Clone(); _cancel = new CancellationTokenSource(); _listener = new TcpListener(endpoint); if(_options.UseNagleAlgorithm.HasValue) _listener.Server.NoDelay = !_options.UseNagleAlgorithm.Value; ConnectionExtensions = new WebSocketConnectionExtensionCollection(this); Standards = new WebSocketFactoryCollection(this); _negotiationQueue = new HttpNegotiationQueue(Standards, ConnectionExtensions, options); }
public WebSocketListener(IPEndPoint endpoint, WebSocketListenerOptions options) { if (options == null) throw new ArgumentNullException("options"); if (endpoint == null) throw new ArgumentNullException("endpoint"); options.CheckCoherence(); _options = options.Clone(); _cancel = new CancellationTokenSource(); _listener = new TcpListener(endpoint); if(_options.UseNagleAlgorithm.HasValue) _listener.Server.NoDelay = !_options.UseNagleAlgorithm.Value; ConnectionExtensions = new WebSocketConnectionExtensionCollection(this); Standards = new WebSocketFactoryCollection(this); _negotiationQueue = new HttpNegotiationQueue(Standards, ConnectionExtensions, options); }