Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 信号机集线器不';重新启动后无法重新创建连接_Javascript_C#_Signalr - Fatal编程技术网

Javascript 信号机集线器不';重新启动后无法重新创建连接

Javascript 信号机集线器不';重新启动后无法重新创建连接,javascript,c#,signalr,Javascript,C#,Signalr,我正在使用JavaScript信号器客户端和.NET信号器服务器应用程序。Octopus Deploy重新部署应用程序后,客户端停止接收来自服务器的任何消息,尽管服务器从客户端接收消息并尝试发回消息 更详细的行为: 客户端打开id为“5dd083cc-f7fe-4b7d-8cae-d0e87b35d51c”的连接 已在服务器上创建连接“5dd083cc-f7fe-4b7d-8cae-d0e87b35d51c” 客户端向服务器发送消息,服务器向客户端发送消息。一切都好 服务器已由Octopus D

我正在使用JavaScript信号器客户端和.NET信号器服务器应用程序。Octopus Deploy重新部署应用程序后,客户端停止接收来自服务器的任何消息,尽管服务器从客户端接收消息并尝试发回消息

更详细的行为:

  • 客户端打开id为“5dd083cc-f7fe-4b7d-8cae-d0e87b35d51c”的连接
  • 已在服务器上创建连接“5dd083cc-f7fe-4b7d-8cae-d0e87b35d51c”
  • 客户端向服务器发送消息,服务器向客户端发送消息。一切都好
  • 服务器已由Octopus Deploy重新部署
  • 客户端从同一连接向服务器发送消息。该消息由服务器接收
  • 服务器向客户端发送消息。未收到消息
  • 在应用程序日志中重新启动服务器后,我看到服务器接收到来自客户端的消息,但没有看到连接已创建。 重启后是否应手动创建信号器连接? 是否可以在不创建连接的情况下接收来自客户端的消息

    以下是我用于日志记录的模块:

    public class LoggingPipelineModule : HubPipelineModule
    {
        protected override void OnIncomingError(ExceptionContext exceptionContext, IHubIncomingInvokerContext invokerContext)
        {
            Logging.Logger.Error(exceptionContext.Error.Message, exceptionContext.Error);
            base.OnIncomingError(exceptionContext, invokerContext);
        }
    
        protected override bool OnBeforeIncoming(IHubIncomingInvokerContext context)
        {
            Logging.Logger.Debug(string.Format(
                "Invoking '{0}' on server hub '{1}' with connection id '{2}'",
                context.MethodDescriptor.Name, 
                context.MethodDescriptor.Hub.Name,
                context.Hub.Context.ConnectionId));
    
            return base.OnBeforeIncoming(context);
        }
    
        protected override bool OnBeforeOutgoing(IHubOutgoingInvokerContext context)
        {
            var connection = context.Connection as Connection;
            if (connection != null)
            {
                Logging.Logger.Debug(string.Format(
                   "Invoking '{0}' on client hub '{1}' with connection id '{2}'",
                   context.Invocation.Method,
                   context.Invocation.Hub,
                   connection.Identity));
            }
            else
            {
                Logging.Logger.Debug(string.Format(
                  "Invoking '{0}' on client hub '{1}'",
                  context.Invocation.Method,
                  context.Invocation.Hub));
            }
    
            return base.OnBeforeOutgoing(context);
        }
    
        protected override void OnAfterConnect(IHub hub)
        {
            Logging.Logger.Debug(string.Format("New connection with id {0} is established", hub.Context.ConnectionId));
            base.OnAfterConnect(hub);
        }
    
        protected override void OnAfterDisconnect(IHub hub, bool stopCalled)
        {
            Logging.Logger.Debug(string.Format("Connection with id {0} was closed", hub.Context.ConnectionId));
            base.OnAfterDisconnect(hub, stopCalled);
        }
    
        protected override void OnAfterReconnect(IHub hub)
        {
            Logging.Logger.Debug(string.Format("Connection with id {0} was recreated", hub.Context.ConnectionId));
            base.OnAfterReconnect(hub);
        }
    }
    
    以下是应用程序日志(没有连接创建):

    2017-03-28 08:40:58,915 [62] DEBUG Invoking 'Push' on client hub 'ServerHub' with connection id '5dd083cc-f7fe-4b7d-8cae-d0e87b35d51c'
    2017-03-28 08:41:18,213 [88] DEBUG Invoking 'Unsubscribe' on server hub 'ServerHub' with connection id '5dd083cc-f7fe-4b7d-8cae-d0e87b35d51c'
    2017-03-28 08:41:18,447 [64] DEBUG Invoking 'Subscribe' on server hub 'ServerHub' with connection id '5dd083cc-f7fe-4b7d-8cae-d0e87b35d51c'
    2017-03-28 08:41:23,916 [64] DEBUG Invoking 'Unsubscribe' on server hub 'ServerHub' with connection id '5dd083cc-f7fe-4b7d-8cae-d0e87b35d51c'
    2017-03-28 08:41:24,151 [62] DEBUG Invoking 'Subscribe' on server hub 'ServerHub' with connection id '5dd083cc-f7fe-4b7d-8cae-d0e87b35d51c'