[BUG] `Disconnected` event gets incorrect values
See original GitHub issueIssue Type
- Bug
Describe the bug
The Disconnected
event returns only values from WebSocketCloseStatus
(1000-1011) and marks them as ObsCloseCodes
. Whereas the OBS protocol returns the values 0, 4000, 4002, 4003-4012.
To Reproduce Steps to reproduce the behavior:
- Connect to OBS
- Place the breakpoint on
OBSWebsocket.OnWebsocketDisconnect()
- Close OBS
- Check the variable
d.CloseStatus
Expected behavior Probably I would like to get either a combined enum from the OBS protocol and the WebSocket enum, or get some kind of remap of WebSocket values to the values from the OBS protocol enum.
Screenshots
Versions OBS Version: 28.0.1 OBS WebSocket Version: OBS WebSocket Dotnet (this library) Version: 257e7b48e1c365fcf2ea3de9f156ded2bf8f5247 OS: Windows 11
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
[Bug]: Network changed events fired with a delay #13375
I believe I'm seeing a related issue. Metamask (injected provider) disconnects whenever the chain is changed to the Binance Test Network.
Read more >Remote Desktop Error "You have been disconnected ...
It happens with both. Until recently, it happened with neither. It occurs when the connection is dropped due to an unreliable connection.
Read more >Understanding Disconnect / Reconnect Process and Error ...
When I disable wifi it takes pusher 4 seconds to notice and change the state to disconnected and then to unavailable .
Read more >Bug - Buffer Overflow after disconnection
It's pretty weird that it only happens when there are multiple client connections though, I'd expect the issue to arise even with one...
Read more >How to Resolve Remote Desktop Disconnected Error
Objective: To resolve the Remote desktop disconnected error due to incorrect configuration of authentication and encryption settings. Incorrectly configured ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I will address this moving forward
I too am seeing 1000, 1001 etc coming in this handler from
e.ObsCloseCode
In my case, connect to OBS, then force close OBS -> 1001.
You asked for a reproduction:
Running this, with OBS open, waiting till you see connected and then closing OBS will result in a 1001 close code.
I think the original poster is saying that the additional codes(<4000) are not documented in the library and that the type(
ObsCloseCodes
) does not handle them. This leads to a confusing experience when consuming this client.I guess that when I consume a client application, I expect an Enum value to not contain values that are not defined in the Enum.
If I were writing this library I would probably either:
In my case, I can handle this with some extra code similar to the original poster, but I do agree with them it is confusing.