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