예제 #1
0
 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));
 }
예제 #4
0
 /// <summary>
 /// 心跳
 /// </summary>
 public void Heartbeat()
 {
     _slabLogger.Log(HubServerType.HubServerVerbose, "HubSync Sending Heartbeat");
     Clients.Caller.Heartbeat();
 }
예제 #5
0
 public void AddMessage(string name, string message)
 {
     _slabLogger.Log(HubType.HubServerVerbose, "HubSync Sending AddMessage " + name + " " + message);
     Clients.All.AddMessage(name, message);
 }