Merge pull request #837 from WhiteXZ/general-devel
Suppresses the SocketException warnings
This commit is contained in:
commit
03cf2487ad
1 changed files with 23 additions and 10 deletions
|
|
@ -206,23 +206,36 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
catch (ObjectDisposedException e)
|
catch (ObjectDisposedException e)
|
||||||
{
|
{
|
||||||
Log.Warn(e.ToString());
|
Log.Warn(e.ToString());
|
||||||
}
|
}
|
||||||
catch (SocketException e)
|
catch (SocketException e)
|
||||||
{
|
{
|
||||||
switch ((uint)e.ErrorCode)
|
switch ((uint)e.ErrorCode)
|
||||||
{
|
{
|
||||||
case 0x80004005:
|
case 0x80004005:
|
||||||
case 10053:
|
case 10053:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Log.Warn(e.ToString());
|
Log.Warn(e.ToString());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
Log.Warn(e.ToString());
|
if (e.InnerException is SocketException)
|
||||||
|
{
|
||||||
|
switch (((SocketException)e.InnerException).SocketErrorCode)
|
||||||
|
{
|
||||||
|
case SocketError.Shutdown:
|
||||||
|
case SocketError.ConnectionReset:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Log.Warn(e.ToString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Log.Warn(e.ToString());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue