MirrorNetworking / kcp2k

MIT License
283 stars 50 forks source link

Add OnError for SocketException #43

Open imerr opened 2 years ago

imerr commented 2 years ago

On windows, when trying to connect to localhost, there seems to be an edge case where instead of timing out or anything like that, windows knows better and raises a socket exception here: "System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host.", which of course doesnt make any sense whatsoever if there's not a server listening to begin with (should be a connection refused really), but thats how it is