-
Notifications
You must be signed in to change notification settings - Fork 140
Closed
Description
In v3, I used the following configuration:
Transport = TransportProtocol.WebSocket,
AutoUpgrade = true,In v4, this seems to lead to an infinite connect loop:
Tracing through the code, it looks like we try to auto-upgrade regardless of whether the transport is already set to WebSocket:
socket.io-client-csharp/src/SocketIOClient/SocketIO.cs
Lines 365 to 380 in bddf159
| private async Task HandleOpenedMessage(IMessage message) | |
| { | |
| if (!Options.AutoUpgrade) | |
| { | |
| return; | |
| } | |
| var openedMessage = (OpenedMessage)message; | |
| if (!openedMessage.Upgrades.Contains("websocket")) | |
| { | |
| return; | |
| } | |
| Options.Transport = TransportProtocol.WebSocket; | |
| await UpgradeTransportAsync(openedMessage).ConfigureAwait(false); | |
| } |
And for some reason, it never breaks out of trying to auto-upgrade the new connection.
The workaround for this problem is simply turning off AutoUpgrade:
AutoUpgrade = false,However, it does seem like this is a bug. We should either not attempt to upgrade WebSocket transports, or figure out why it doesn't break out of that connect loop. Or both! :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels