From: Bryan Duxbury Date: Tue, 8 Feb 2011 16:38:15 +0000 (+0000) Subject: THRIFT-1055. csharp: csharp TServerSocket and TSocket do not disable Nagle via Socket... X-Git-Tag: 0.7.0~195 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=2d9dfdb88e58ab5b961726a5506a4f3e0653b807;p=common%2Fthrift.git THRIFT-1055. csharp: csharp TServerSocket and TSocket do not disable Nagle via Socket.NoDelay = true like cpp and java do This patch sets NoDelay on TSocket and TServerSocket to improve performance. Patch: Chris Morgan git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1068470 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/csharp/src/Transport/TServerSocket.cs b/lib/csharp/src/Transport/TServerSocket.cs index 218291af..fd5c662c 100644 --- a/lib/csharp/src/Transport/TServerSocket.cs +++ b/lib/csharp/src/Transport/TServerSocket.cs @@ -91,6 +91,7 @@ namespace Thrift.Transport { // Make server socket server = new TcpListener(System.Net.IPAddress.Any, this.port); + server.Server.NoDelay = true; } catch (Exception) { diff --git a/lib/csharp/src/Transport/TSocket.cs b/lib/csharp/src/Transport/TSocket.cs index 4c64a360..feb5503c 100644 --- a/lib/csharp/src/Transport/TSocket.cs +++ b/lib/csharp/src/Transport/TSocket.cs @@ -61,6 +61,7 @@ namespace Thrift.Transport { client = new TcpClient(); client.ReceiveTimeout = client.SendTimeout = timeout; + client.Client.NoDelay = true; } public int Timeout