SignalR 2 long polling “protocol” request times out when not ran locally

家住魔仙堡 提交于 2019-12-05 17:45:51

So there's a TransportConnectTimeout now in 2.0.0 SignalR. It sounds like having your SQL backplane is slowing down the connect process resulting in your transports to timeout.

You can modify the TransportConnectTimeout on the server via:

GlobalHost.Configuration.TransportConnectTimeout = TimeSpan.FromSeconds(10);

Therefore whenever a client tries to connect it will abide by the new timeout.

You can also modify this value on the client. When modified the client takes it's TransportConnectTimeout and adds it to the servers and then uses the result as the timeout. Here's how to modify the client:

$.connection.hub.transportConnectTimeout = 3000;

If the server's TransportConnectTimeout is 5s that means the client will abide by an 8s timeout window when trying to connect.

You can choose to modify one of the values, or both of the values, it doesn't matter, whatever fits your needs!

Hope this helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!