Skip to content

JS client fallback wait transportConnectTimeout then start next transport  #2902

@Xiaohongt

Description

@Xiaohongt

When JS client fallback, webSockets or foreverFrame connection wait until the time transportConnectTimeout then start next transport, doesn't optimize start next after transport failed, e.g. set transportConnectTimeout = 60 seconds, logging for repro:

   [20:57:05 GMT-0800 (Pacific Standard Time)] SignalR: Client subscribed to hub 'hubconnectionapi'.
   [20:57:05 GMT-0800 (Pacific Standard Time)] SignalR: Negotiating with '/signalr/negotiate?connectionData=%5B%7B%22name%22%3A%22hubconnectionapi%22%7D%5D&clientProtocol=1.3'.
   [20:57:05 GMT-0800 (Pacific Standard Time)] SignalR: Connecting to websocket endpoint 'ws://localhost:40476/signalr/connect?transport=webSockets&connectionToken=axnc71f0avRLAlKYifqjgGWK0tYrxLdo8MuUR71bUH3Ufeix%2FS0k7qGg60A1ior0cN60xMXHrswyBUwX7ja3Ooj8VLkv2rTUKW0sEvSWUaxiREdEcJJaHsRi1McvyImc&connectionData=%5B%7B%22name%22%3A%22hubconnectionapi%22%7D%5D&tid=4'.
   [20:57:05 GMT-0800 (Pacific Standard Time)] SignalR: Websocket opened.
   [20:57:05 GMT-0800 (Pacific Standard Time)] SignalR: Websocket closed.
   [20:58:05 GMT-0800 (Pacific Standard Time)] SignalR: webSockets timed out when trying to connect.
   [20:58:05 GMT-0800 (Pacific Standard Time)] SignalR: Closing the Websocket.
   [20:58:05 GMT-0800 (Pacific Standard Time)] SignalR: This browser doesn't support SSE.
   [20:58:05 GMT-0800 (Pacific Standard Time)] SignalR: Binding to iframe's load event.
   [20:58:05 GMT-0800 (Pacific Standard Time)] SignalR: Forever frame iframe finished loading and is no longer receiving messages, reconnecting.
   [20:59:05 GMT-0800 (Pacific Standard Time)] SignalR: foreverFrame timed out when trying to connect.
   [20:59:05 GMT-0800 (Pacific Standard Time)] SignalR: Stopping forever frame.
   [20:59:05 GMT-0800 (Pacific Standard Time)] SignalR: Opening long polling request to 'http://localhost:40476/signalr/connect?transport=longPolling&connectionToken=axnc71f0avRLAlKYifqjgGWK0tYrxLdo8MuUR71bUH3Ufeix%2FS0k7qGg60A1ior0cN60xMXHrswyBUwX7ja3Ooj8VLkv2rTUKW0sEvSWUaxiREdEcJJaHsRi1McvyImc&connectionData=%5B%7B%22name%22%3A%22hubconnectionapi%22%7D%5D&tid=8'.
   [20:59:05 GMT-0800 (Pacific Standard Time)] SignalR: Stopping connection.
   [20:59:05 GMT-0800 (Pacific Standard Time)] SignalR: Fired ajax abort async = true.
   [20:59:05 GMT-0800 (Pacific Standard Time)] SignalR: LongPolling failed to connect.

Note,
It is not regression.
SSE doesn't repro

Repro:
1.use the aspnet sample, change to use Sql scale-out, but stop the Sql server service, set GlobalHost.Configuration.TransportConnectTimeout = TimeSpan.FromSeconds(60)
2.request HubConnectionAPI/default.aspx

Actual Result:
webSockets / foreverFrame connection wait until transportConnectTimeout then start next transport

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions