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