THRIFT-2952 Improve handling of Server.Stop()
Client: C#
Patch: Jens Geyer
This closes #361
diff --git a/lib/csharp/src/Server/TThreadPoolServer.cs b/lib/csharp/src/Server/TThreadPoolServer.cs
index aff5733..4c201e9 100644
--- a/lib/csharp/src/Server/TThreadPoolServer.cs
+++ b/lib/csharp/src/Server/TThreadPoolServer.cs
@@ -118,11 +118,7 @@
}
catch (TTransportException ttx)
{
- if (stop)
- {
- logDelegate("TThreadPoolServer was shutting down, caught " + ttx.GetType().Name);
- }
- else
+ if (!stop || ttx.Type != TTransportException.ExceptionType.Interrupted)
{
++failureCount;
logDelegate(ttx.ToString());
@@ -170,7 +166,7 @@
connectionContext = serverEventHandler.createContext(inputProtocol, outputProtocol);
//Process client requests until client disconnects
- while (true)
+ while (!stop)
{
if (!inputTransport.Peek())
break;