protected override void OnIncomingError(ExceptionContext ex, IHubIncomingInvokerContext context) { _slabLogger.Log(HubServerType.HubServerVerbose, "=> Exception " + ex.Error + " " + ex.Result); if (ex.Error.InnerException != null) { _slabLogger.Log(HubServerType.HubServerVerbose, "=> Inner Exception " + ex.Error.InnerException.Message); } base.OnIncomingError(ex, context); }
public void AddMessage(string name, string message) { _hubContext.Clients.All.addMessage("MyHub", "ServerMessage"); _slabLogger.Log(HubType.HubServerVerbose, "MyHub Sending addMessage"); }
protected override bool OnBeforeIncoming(IHubIncomingInvokerContext context) { _slabLogger.Log(HubType.HubServerVerbose, "=> Invoking " + context.MethodDescriptor.Name + " on hub " + context.MethodDescriptor.Hub.Name); return(base.OnBeforeIncoming(context)); }
/// <summary> /// 心跳 /// </summary> public void Heartbeat() { _slabLogger.Log(HubServerType.HubServerVerbose, "HubSync Sending Heartbeat"); Clients.Caller.Heartbeat(); }
public void AddMessage(string name, string message) { _slabLogger.Log(HubType.HubServerVerbose, "HubSync Sending AddMessage " + name + " " + message); Clients.All.AddMessage(name, message); }