Пример #1
0
 public static ServiceClientProxy CreateSingleGroupExceptProxy(this SignalR signalr, string hubName, string groupName,
                                                               IReadOnlyList <string> excludedIds)
 {
     return(new ServiceClientProxy(
                $"http://{signalr.HostName}/{signalr.ApiVersion}/hub/{hubName}/group/{groupName}",
                () => signalr.GenerateServerToken(hubName), excludedIds));
 }
Пример #2
0
        internal void UseService(SignalR signalr)
        {
            var serviceUrl  = GetServiceUrl(signalr);
            var httpOptions = new HttpOptions
            {
                JwtBearerTokenFactory = signalr.GenerateServerToken <THub>
            };

            for (var i = 0; i < signalr.ConnectionNumber; i++)
            {
                var serviceConnection = CreateServiceConnection(serviceUrl, httpOptions);
                _serviceConnections.Add(serviceConnection);
            }
        }
Пример #3
0
 public static ServiceClientProxy CreateAllClientsProxy(this SignalR signalr, string hubName)
 {
     return(new ServiceClientProxy(
                $"http://{signalr.HostName}/{signalr.ApiVersion}/hub/{hubName}",
                () => signalr.GenerateServerToken(hubName)));
 }
Пример #4
0
 public static ServiceClientProxy CreateMultipleGroupProxy(this SignalR signalr, string hubName, IReadOnlyList <string> groupNames)
 {
     return(new ServiceClientProxy(
                $"http://{signalr.HostName}/{signalr.ApiVersion}/hub/{hubName}/groups/{string.Join(",", groupNames)}",
                () => signalr.GenerateServerToken(hubName)));
 }
Пример #5
0
 public static ServiceClientProxy CreateSingleUserProxy(this SignalR signalr, string hubName, string userId)
 {
     return(new ServiceClientProxy(
                $"http://{signalr.HostName}/{signalr.ApiVersion}/hub/{hubName}/user/{userId}",
                () => signalr.GenerateServerToken(hubName)));
 }
Пример #6
0
 public HubServerBuilder(IServiceProvider serviceProvider, SignalR signalr)
 {
     _serviceProvider = serviceProvider;
     _signalr         = signalr;
 }
Пример #7
0
 public HubProxy(SignalR signalr, string hubName)
 {
     _signalr = signalr;
     HubName  = hubName;
     All      = _signalr.CreateAllClientsProxy(HubName);
 }
Пример #8
0
 private Uri GetServiceUrl(SignalR signalr)
 {
     return(new Uri(signalr.GetServerUrl <THub>()));
 }