Closed johnyburd closed 2 years ago
When establishing a connection, the library will throw an exception if the network is unavailable. On different platforms, the exception type will be different.
Therefore, if the library cannot connect to the server, causing this exception, you should do this to ensure that the library can reconnect.
var client = new SocketIO("http://localhost:11000/“);
// ...
client.AddExpectedException(typeof(XxxException));
// ...
just like xamarin
When I was looking through the README I thought AddExpectedException
was a Xamarin utility. I see now, thank you.
My app is running in an environment where the network connection is somewhat unstable. When my machine disconnects from the network, the library (intermittently) raises this unhandled exception:
I'm on version 3.0.5.
I see the readme has some info on how to handle these exceptions in Xamarin, but I'm running a dotnet 6 service worker.