Oops we need to use SocketException instead of IOException now.

This commit is contained in:
UnknownShadow200 2016-08-15 13:22:55 +10:00
parent 0936dd7e50
commit bd1f2c9597

View File

@ -76,7 +76,7 @@ namespace ClassicalSharp.Network {
try { try {
reader.ReadPendingData(); reader.ReadPendingData();
} catch( IOException ex ) { } catch( SocketException ex ) {
ErrorHandler.LogError( "reading packets", ex ); ErrorHandler.LogError( "reading packets", ex );
game.Disconnect( "&eLost connection to the server", "I/O error when reading packets" ); game.Disconnect( "&eLost connection to the server", "I/O error when reading packets" );
Dispose(); Dispose();
@ -129,7 +129,7 @@ namespace ClassicalSharp.Network {
} }
try { try {
writer.Send(); writer.Send();
} catch( IOException ) { } catch( SocketException ) {
// NOTE: Not immediately disconnecting, as otherwise we sometimes miss out on kick messages // NOTE: Not immediately disconnecting, as otherwise we sometimes miss out on kick messages
writer.index = 0; writer.index = 0;
} }