public WebSocketTransport(Uri url, PipeOptions outputoptions = default, PipeOptions inputoptions = default, WebSocketOptions options = default) { Url = url; Options = options ?? WebSocketsTransport.DefaultWebSocketOptions; Logger = new Microsoft.Extensions.Logging.LoggerFactory(new[] { new Microsoft.Extensions.Logging.Debug.DebugLoggerProvider() }); (Front, Back) = DuplexPipe.CreatePair(outputoptions, inputoptions); Transport = new WebSocketsTransport(Options, Back, WebSocketsTransport.HttpConnectionContext.Default, Logger); }
public ClientSocketTransport(IPAddress ip, int port, PipeOptions outputOptions = default, PipeOptions inputOptions = default, WebSocketOptions options = default) : base(outputOptions, inputOptions) { this.IP = ip; this.Port = port; }
public SocketTransport(Uri url, PipeOptions outputoptions = default, PipeOptions inputoptions = default, WebSocketOptions options = default) { Url = url; if (string.Compare(url.Scheme, "TCP", true) != 0) { throw new ArgumentException("Only TCP connections are supported.", nameof(Url)); } if (url.Port == -1) { throw new ArgumentException("TCP Port must be specified.", nameof(Url)); } //Options = options ?? WebSocketsTransport.DefaultWebSocketOptions; //Logger = new Microsoft.Extensions.Logging.LoggerFactory(new[] { new Microsoft.Extensions.Logging.Debug.DebugLoggerProvider() }); (Front, Back) = DuplexPipe.CreatePair(outputoptions, inputoptions); //Transport = new SocketsTransport(Options, Back, WebSocketsTransport.HttpConnectionContext.Default, Logger); }
public ClientSocketTransport(string ip, int port, PipeOptions outputOptions = default, PipeOptions inputOptions = default, WebSocketOptions options = default) : this(IPAddress.Parse(ip), port, outputOptions, inputOptions, options) { }