0

我们有一个客户端和一个服务器,它们通过信号器进行通信。在客户端第一次启动时,它能够通过信号器与服务器连接,并通过集线器与一些信号器方法进行通信。但是在特定事件之后,服务器无法通过信号器进行通信。但在客户端它显示为连接已连接。以下是与服务器连接后来自客户端的信号器跟踪日志。

9492fb51-e37b-4f6c-b184-536c87dd73f1 - SSE: OnMessage(Data: initialized)
9492fb51-e37b-4f6c-b184-536c87dd73f1 - SSE: OnMessage(Data: {"C":"s-0,C5FA","S":1,"M":[]})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - OnMessage({"I":"93"})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - ChangeState(Connecting, Connected)
9492fb51-e37b-4f6c-b184-536c87dd73f1 - SSE: OnMessage(Data: {"C":"s-0,C636","M":[{"H":"PrintConnectorHub","M":"Registered","A":[{"Connected":false,"ErrorCount":0,"InstalledBy":{"EmployeeId":1111,"Firstname":null,"Lastname":null},"Name":"*** ***","Server":{"ComputerName":"**","IPAddress":"****","MACAddress":"****","OperatingSystem":"Microsoft® Windows Server® 2008 Standard FE "},"Status":0,"Version":"1.4.4"}]}]})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - OnMessage({"R":false,"I":"90"})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - Callback with id 90 not found!
9492fb51-e37b-4f6c-b184-536c87dd73f1 - OnMessage({"R":false,"I":"94"})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - OnMessage({"R":false,"I":"92"})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - Callback with id 92 not found!
9492fb51-e37b-4f6c-b184-536c87dd73f1 - SSE: OnMessage(Data: {})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - SSE: OnMessage(Data: {})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - SSE: OnMessage(Data: {})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - SSE: OnMessage(Data: {})

在此之后,尽管客户端仍然是连接的服务器,但无法通过信号器向客户端发送任何消息。我们的 2 个客户端和所有客户端信号器跟踪日志都面临这个问题,它在连接被触发后显示了这些日志行。

9492fb51-e37b-4f6c-b184-536c87dd73f1 - SSE: OnMessage(Data: {"C":"s-0,C636","M":[{"H":"PrintConnectorHub","M":"Registered","A":[{"Connected":false,"ErrorCount":0,"InstalledBy":{"EmployeeId":1111,"Firstname":null,"Lastname":null},"Name":"*** ***","Server":{"ComputerName":"**","IPAddress":"****","MACAddress":"****","OperatingSystem":"Microsoft® Windows Server® 2008 Standard FE "},"Status":0,"Version":"1.4.4"}]}]})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - OnMessage({"R":false,"I":"90"})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - Callback with id 90 not found!
9492fb51-e37b-4f6c-b184-536c87dd73f1 - OnMessage({"R":false,"I":"94"})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - OnMessage({"R":false,"I":"92"})
9492fb51-e37b-4f6c-b184-536c87dd73f1 - Callback with id 92 not found!

41889ccd-5634-440a-95ef-fbbdcd340a19 - SSE: OnMessage(Data: {"C":"s-0,C634","M":[{"H":"PrintConnectorHub","M":"Registered","A":[{"Connected":false,"ErrorCount":0,"InstalledBy":{"EmployeeId":1111,"Firstname":null,"Lastname":null},"Name":"***","Server":{"ComputerName":"****","IPAddress":"****","MACAddress":"****","OperatingSystem":"Microsoft Windows Server 2008 R2 Standard "},"Status":0,"Version":"1.3.8"}]}]})
41889ccd-5634-440a-95ef-fbbdcd340a19 - SSE: OnMessage(Data: {})
41889ccd-5634-440a-95ef-fbbdcd340a19 - OnMessage({"R":false,"I":"611"})
41889ccd-5634-440a-95ef-fbbdcd340a19 - Callback with id 611 not found!
41889ccd-5634-440a-95ef-fbbdcd340a19 - OnMessage({"R":false,"I":"615"})
41889ccd-5634-440a-95ef-fbbdcd340a19 - OnMessage({"R":false,"I":"613"})
41889ccd-5634-440a-95ef-fbbdcd340a19 - Callback with id 613 not found!

我们正在使用 SQl 服务器和 SQL 服务器中的背板设置来使用横向扩展。上面的日志跟踪回调中未找到 id 意味着什么?即使客户端日志显示为连接,服务器也无法与客户端通信可能是什么问题?

4

1 回答 1

1

未找到 ID 为 613 的回调!未找到 ID 为 611 的回调!

它说它在 Hub 上找不到合适的方法。您是否检查过您在正确的集线器上调用正确的方法名称?

你可以检查调用方法和参数这样做:
定义你的管道模块

public class MyPipelineModule : HubPipelineModule
{
    protected override bool OnBeforeIncoming(IHubIncomingInvokerContext context)
    {
        //context.Args
        //context.Hub
        //context.MethodDescriptor.Name
        return base.OnBeforeIncoming(context);
    }
}

在您配置 SignalR 的地方:

GlobalHost.HubPipeline.AddModule(new MyPipelineModule());
于 2017-02-01T17:49:05.353 回答