I’ve found there are frequently issues with WebSocketSharp when we try to connect to Discord or the Curse app - I switched the package out for ‘WebSocket4Net’ and it’s fixed a LOT of issues. Both are derived projects from the same top level project [SuperSocket], so should be an almost 1:1 swap for methods after the initial connection process.
That being said, the connection itself shouldn’t be wrapped in a using. There needs to be a shutdown method that uses a try:catch:finally syntax, and the finally calls the shutdown/dispose method. (Basically, hold a reference to the socket until you actually intend for the application to shut down the socket)
Well, technically you can use a using, but if you do you have to wrap your whole class in it, which is usually pretty gross.