public ClientWebSocketConnectorOfT(IServiceProvider serviceProvider, IClientInvocatorContextFactory <TInvocator> invocatorContextFactory, IStreamCompressor compressor, ILoggerFactory loggerFactory) : base(serviceProvider, compressor, loggerFactory) { _invocatorContextFactory = invocatorContextFactory ?? throw new ArgumentNullException(nameof(invocatorContextFactory)); InvocatorContext = _invocatorContextFactory.CreateInvocatorContext(); }
public static void EnsureHostPair(ClientInvocatorContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } var invocator = context.Invocator; var connectorName = context.ConnectorName; var hostAddress = context.HostAddress; EnsureHostPair(invocator, connectorName, hostAddress); }
public ClientInvocatorContext CreateInvocatorContext() { var context = new ClientInvocatorContext(_proxyOptions.Invocator, _proxyOptions.ConnectorName, _proxyOptions.WebSocketHostAddress); if (_proxyOptions.OnConnectedAsync != null) { context.OnConnectedAsync = _proxyOptions.OnConnectedAsync; } if (_proxyOptions.OnDisconnectedAsync != null) { context.OnDisconnectedAsync = _proxyOptions.OnDisconnectedAsync; } return(context); }