Beispiel #1
0
 public HubConnection(string url, HttpConnectionOptions options, bool addMessagePack)
 {
     this.Url     = url;
     this.Options = options;
     this.InternalConnectionId = Guid.NewGuid().ToString();
     HubConnectionManager.AddConnection(this, addMessagePack);
 }
Beispiel #2
0
 public void On(string methodName, Func <object, Task> handler)
 {
     if (string.IsNullOrEmpty(methodName))
     {
         throw new ArgumentNullException(nameof(methodName));
     }
     this._handlers[methodName] = handler ?? throw new ArgumentNullException(nameof(handler));
     HubConnectionManager.On(this.InternalConnectionId, methodName);
 }
Beispiel #3
0
 public void Dispose() => HubConnectionManager.RemoveConnection(this.InternalConnectionId);