/// <summary> /// Initializes a new instance of the <see cref="HubConnectionContext"/>. /// </summary> /// <param name="pipelineInvoker">The pipeline invoker.</param> /// <param name="connection">The connection.</param> /// <param name="hubName">The hub name.</param> /// <param name="connectionId">The connection id.</param> /// <param name="state">The connection hub state.</param> public HubConnectionContext(IHubPipelineInvoker pipelineInvoker, IConnection connection, string hubName, string connectionId, TrackingDictionary state) { _send = (signal, invocation, exclude) => pipelineInvoker.Send(new HubOutgoingInvokerContext(connection, signal, invocation, exclude)); _connectionId = connectionId; _hubName = hubName; Caller = new StatefulSignalProxy(_send, connectionId, hubName, state); All = AllExcept(); Others = AllExcept(connectionId); }
/// <summary> /// Initializes a new instance of the <see cref="HubConnectionContext"/>. /// </summary> /// <param name="pipelineInvoker">The pipeline invoker.</param> /// <param name="connection">The connection.</param> /// <param name="hubName">The hub name.</param> /// <param name="connectionId">The connection id.</param> /// <param name="tracker">The connection hub state.</param> public HubConnectionContext(IHubPipelineInvoker pipelineInvoker, IConnection connection, string hubName, string connectionId, StateChangeTracker tracker) { _send = (signal, invocation, exclude) => pipelineInvoker.Send(new HubOutgoingInvokerContext(connection, signal, invocation, exclude)); _connectionId = connectionId; _hubName = hubName; Caller = new StatefulSignalProxy(_send, connectionId, PrefixHelper.HubConnectionIdPrefix, hubName, tracker); All = AllExcept(); Others = AllExcept(connectionId); }
public Task Invoke(string method, params object[] args) { var invocation = GetInvocationData(method, args); var context = new HubOutgoingInvokerContext(_connection, _signals, invocation) { ExcludedSignals = _exclude }; return(_invoker.Send(context)); }
public Task Invoke(string method, params object[] args) { var invocation = new ClientHubInvocation { Hub = _hubName, Method = method, Args = args }; var context = new HubOutgoingInvokerContext(_connection, _signal, invocation) { ExcludedSignals = _exclude }; return(_invoker.Send(context)); }