public HubProxy(string endpoint, string accessKey, string hubName, HubProxyOptions options) { if (string.IsNullOrEmpty(endpoint)) { throw new ArgumentNullException(nameof(endpoint)); } if (string.IsNullOrEmpty(accessKey)) { throw new ArgumentNullException(nameof(accessKey)); } if (string.IsNullOrEmpty(hubName)) { throw new ArgumentNullException(nameof(hubName)); } Clients = new HubClientsProxy(endpoint, accessKey, hubName, options); Groups = new GroupManagerProxy(endpoint, accessKey, hubName, options); HubName = hubName.ToLower(); }
public GroupManagerProxy(string endpoint, string accessKey, string hubName, HubProxyOptions options) { if (string.IsNullOrEmpty(endpoint)) { throw new ArgumentNullException(nameof(endpoint)); } if (string.IsNullOrEmpty(accessKey)) { throw new ArgumentNullException(nameof(accessKey)); } if (string.IsNullOrEmpty(hubName)) { throw new ArgumentNullException(nameof(hubName)); } var apiVersion = options?.ApiVersion ?? HubProxyOptions.DefaultApiVersion; _baseUri = $"{endpoint}:{ProxyPort}/{apiVersion}/hub/{hubName.ToLower()}/group"; _accessKey = accessKey; }
public HubClientsProxy(string endpoint, string accessKey, string hubName, HubProxyOptions options) { if (string.IsNullOrEmpty(endpoint)) { throw new ArgumentNullException(nameof(endpoint)); } if (string.IsNullOrEmpty(accessKey)) { throw new ArgumentNullException(nameof(accessKey)); } if (string.IsNullOrEmpty(hubName)) { throw new ArgumentNullException(nameof(hubName)); } _endpoint = endpoint; _accessKey = accessKey; _hubName = hubName.ToLower(); _options = options ?? HubProxyOptions.DefaultHubProxyOptions; All = ClientProxyFactory.CreateAllClientsProxy(_endpoint, _options.ApiVersion, _accessKey, _hubName); }
public static HubProxy CreateHubProxyFromConnectionString(string connectionString, string hubName, HubProxyOptions options) { var connStr = ParseConnectionString(connectionString); return(new HubProxy(connStr.Endpoint, connStr.AccessKey, hubName)); }
public static HubProxy CreateHubProxyFromConnectionString <THub>(string connectionString, HubProxyOptions options) where THub : Hub { return(CreateHubProxyFromConnectionString(connectionString, typeof(THub).Name, options)); }