Пример #1
0
 protected void StartHubInternal()
 {
     try
     {
         _hubConnection.Start().Wait();
     }
     catch (Exception ex)
     {
         SlabClientLogger.Log(HubClientType.HubClientError, ex.Message + " " + ex.StackTrace);
     }
 }
Пример #2
0
 public void Recieve_RefreshAllClientList(ConcurrentDictionary <string, UserInfo> _userInfoList)
 {
     userInfoList = _userInfoList;
     if (userInfoList != null && userInfoList.Count > 0)
     {
         foreach (var keyValuePair in userInfoList)
         {
             SlabClientLogger.Log(HubClientType.HubClientInformational, $"【{keyValuePair.Value.ConnectionId}】:{keyValuePair.Value.UserName}");
         }
     }
 }
Пример #3
0
 public override void RefreshAllClientList()
 {
     _myHubProxy.Invoke("RefreshAllClientList").ContinueWith(task =>
     {
         if (task.IsFaulted)
         {
             if (task.Exception != null)
             {
                 SlabClientLogger.Log(HubClientType.HubClientError, "There was an error opening the connection:" + task.Exception.GetBaseException());
             }
         }
     }).Wait();
 }
Пример #4
0
 public override void SendToOtherManyGroups(IList <string> groupNameList, string name, string message)
 {
     _myHubProxy.Invoke("SendToOtherManyGroups", groupNameList, name, message).ContinueWith(task =>
     {
         if (task.IsFaulted)
         {
             if (task.Exception != null)
             {
                 SlabClientLogger.Log(HubClientType.HubClientError, "There was an error opening the connection:" + task.Exception.GetBaseException());
             }
         }
     }).Wait();
 }
Пример #5
0
 public override void SendToGroupExcept(string groupName, string name, string message, params string[] connectionIds)
 {
     _myHubProxy.Invoke("SendToGroupExcept", groupName, name, message, connectionIds).ContinueWith(task =>
     {
         if (task.IsFaulted)
         {
             if (task.Exception != null)
             {
                 SlabClientLogger.Log(HubClientType.HubClientError, "There was an error opening the connection:" + task.Exception.GetBaseException());
             }
         }
     }).Wait();
 }
Пример #6
0
 public override void SendToSingle(string toConnectionID, string name, string message)
 {
     _myHubProxy.Invoke("SendToSingle", toConnectionID, name, message).ContinueWith(task =>
     {
         if (task.IsFaulted)
         {
             if (task.Exception != null)
             {
                 SlabClientLogger.Log(HubClientType.HubClientError, "There was an error opening the connection:" + task.Exception.GetBaseException());
             }
         }
     }).Wait();
 }
Пример #7
0
 public override void Unsubscribe(string name)
 {
     _myHubProxy.Invoke("Unsubscribe", name).ContinueWith(task =>
     {
         if (task.IsFaulted)
         {
             if (task.Exception != null)
             {
                 SlabClientLogger.Log(HubClientType.HubClientError, "There was an error opening the connection:" + task.Exception.GetBaseException());
             }
         }
     }).Wait();
     SlabClientLogger.Log(HubClientType.HubClientInformational, "Unsubscribe成功");
 }
Пример #8
0
 void _hubConnection_StateChanged(StateChange obj)
 {
     SlabClientLogger.Log(HubClientType.HubClientInformational,
                          "_hubConnection_StateChanged New State:" + _hubConnection.State + " " + _hubConnection.ConnectionId);
 }
Пример #9
0
 void _hubConnection_Error(Exception obj)
 {
     SlabClientLogger.Log(HubClientType.HubClientError,
                          "_hubConnection_Error New State:" + _hubConnection.State + " " + _hubConnection.ConnectionId);
 }
Пример #10
0
 void _hubConnection_ConnectionSlow()
 {
     SlabClientLogger.Log(HubClientType.HubClientInformational,
                          "_hubConnection_ConnectionSlow New State:" + _hubConnection.State + " " + _hubConnection.ConnectionId);
 }
Пример #11
0
 public void Recieve_GetCurrentUserInfo(UserInfo userInfo)
 {
     SlabClientLogger.Log(HubClientType.HubClientInformational, $"【{userInfo.ConnectionId}】:{userInfo.UserName}");
 }
Пример #12
0
 public void Recieve_SendMessage(string name, string message)
 {
     SlabClientLogger.Log(HubClientType.HubClientInformational, $"【{name}】:{message}");
 }
Пример #13
0
 public void Recieve_Heartbeat()
 {
     SlabClientLogger.Log(HubClientType.HubClientInformational, "Recieved heartbeat Success");
 }