THRIFT-2654 reduce number of server exceptions
Client: C#
Patch: Craig Peterson
This closes #177
diff --git a/lib/csharp/src/Server/TSimpleServer.cs b/lib/csharp/src/Server/TSimpleServer.cs
index 75f8241..42e0cbe 100644
--- a/lib/csharp/src/Server/TSimpleServer.cs
+++ b/lib/csharp/src/Server/TSimpleServer.cs
@@ -118,6 +118,9 @@
//Process client requests until client disconnects
while (true)
{
+ if (!inputTransport.Peek())
+ break;
+
//Fire processContext server event
//N.B. This is the pattern implemented in C++ and the event fires provisionally.
//That is to say it may be many minutes between the event firing and the client request
diff --git a/lib/csharp/src/Server/TThreadPoolServer.cs b/lib/csharp/src/Server/TThreadPoolServer.cs
index f26a683..8542b6d 100644
--- a/lib/csharp/src/Server/TThreadPoolServer.cs
+++ b/lib/csharp/src/Server/TThreadPoolServer.cs
@@ -172,6 +172,9 @@
//Process client requests until client disconnects
while (true)
{
+ if (!inputTransport.Peek())
+ break;
+
//Fire processContext server event
//N.B. This is the pattern implemented in C++ and the event fires provisionally.
//That is to say it may be many minutes between the event firing and the client request
diff --git a/lib/csharp/src/Server/TThreadedServer.cs b/lib/csharp/src/Server/TThreadedServer.cs
index 5e707f5..87bff31 100644
--- a/lib/csharp/src/Server/TThreadedServer.cs
+++ b/lib/csharp/src/Server/TThreadedServer.cs
@@ -204,6 +204,9 @@
//Process client requests until client disconnects
while (true)
{
+ if (!inputTransport.Peek())
+ break;
+
//Fire processContext server event
//N.B. This is the pattern implemented in C++ and the event fires provisionally.
//That is to say it may be many minutes between the event firing and the client request