public async Task Subscribe(string service, string eventName, object credentials = null) { if (!Ws.IsConnected) { throw new Exception("ws is not connected"); } var subRequest = new HubRequest { service = service, eventName = eventName, credentials = credentials, method = "subscribe" }; if (_subscriptions.Contains(subRequest)) { _subscriptions.Remove(subRequest); } await _restProtocol.RequestAsync(subRequest); _subscriptions.Add(subRequest); if (EventSubscribed != null) { EventSubscribed(this, new EventArgs <HubRequest>(subRequest)); } }
public Task RequestAsync(RestRequest req, int timeout = 0) { return(_restProtocol.RequestAsync(req, timeout)); }