示例#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>()));
 }