protected void StartHubInternal() { try { _hubConnection.Start().Wait(); } catch (Exception ex) { SlabClientLogger.Log(HubClientType.HubClientError, ex.Message + " " + ex.StackTrace); } }
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}"); } } }
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(); }
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(); }
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(); }
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(); }
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成功"); }
void _hubConnection_StateChanged(StateChange obj) { SlabClientLogger.Log(HubClientType.HubClientInformational, "_hubConnection_StateChanged New State:" + _hubConnection.State + " " + _hubConnection.ConnectionId); }
void _hubConnection_Error(Exception obj) { SlabClientLogger.Log(HubClientType.HubClientError, "_hubConnection_Error New State:" + _hubConnection.State + " " + _hubConnection.ConnectionId); }
void _hubConnection_ConnectionSlow() { SlabClientLogger.Log(HubClientType.HubClientInformational, "_hubConnection_ConnectionSlow New State:" + _hubConnection.State + " " + _hubConnection.ConnectionId); }
public void Recieve_GetCurrentUserInfo(UserInfo userInfo) { SlabClientLogger.Log(HubClientType.HubClientInformational, $"【{userInfo.ConnectionId}】:{userInfo.UserName}"); }
public void Recieve_SendMessage(string name, string message) { SlabClientLogger.Log(HubClientType.HubClientInformational, $"【{name}】:{message}"); }
public void Recieve_Heartbeat() { SlabClientLogger.Log(HubClientType.HubClientInformational, "Recieved heartbeat Success"); }