From 84f14d71c9a516649e55a1c09a2a823018fd83cf Mon Sep 17 00:00:00 2001 From: kimw Date: Tue, 5 Jan 2016 00:01:06 +0800 Subject: [PATCH] clean up avoid log message on timeout and network cut off. it's useless but confuse users. --- shadowsocks-csharp/Controller/Logging.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/shadowsocks-csharp/Controller/Logging.cs b/shadowsocks-csharp/Controller/Logging.cs index 3db34658..edf84144 100755 --- a/shadowsocks-csharp/Controller/Logging.cs +++ b/shadowsocks-csharp/Controller/Logging.cs @@ -84,11 +84,19 @@ namespace Shadowsocks.Controller } else if (se.SocketErrorCode == SocketError.NotConnected) { - // close when not connected + // The application tried to send or receive data, and the System.Net.Sockets.Socket is not connected. + } + else if (se.SocketErrorCode == SocketError.HostUnreachable) + { + // There is no network route to the specified host. + } + else if (se.SocketErrorCode == SocketError.TimedOut) + { + // The connection attempt timed out, or the connected host has failed to respond. } else { - Console.WriteLine(e); + Info(e); } } else if (e is ObjectDisposedException) @@ -96,7 +104,7 @@ namespace Shadowsocks.Controller } else { - Console.WriteLine(e); + Info(e); } } }