THRIFT-2408 Named Pipe Transport Option for C#
Patch: Carl Yeksigian & Jens Geyer
diff --git a/lib/csharp/test/ThriftTest/TestClient.cs b/lib/csharp/test/ThriftTest/TestClient.cs
index c7b81b4..ba2d4d0 100644
--- a/lib/csharp/test/ThriftTest/TestClient.cs
+++ b/lib/csharp/test/ThriftTest/TestClient.cs
@@ -37,7 +37,7 @@
{
string host = "localhost";
int port = 9090;
- string url = null;
+ string url = null, pipe = null;
int numThreads = 1;
bool buffered = false, framed = false;
@@ -72,6 +72,11 @@
framed = true;
Console.WriteLine("Using framed transport");
}
+ else if (args[i] == "-pipe") // -pipe <name>
+ {
+ pipe = args[++i];
+ Console.WriteLine("Using named pipes transport");
+ }
else if (args[i] == "-t")
{
numThreads = Convert.ToInt32(args[++i]);
@@ -94,7 +99,14 @@
threads[test] = t;
if (url == null)
{
- TTransport trans = new TSocket(host, port);
+ // endpoint transport
+ TTransport trans = null;
+ if( pipe != null)
+ trans = new TNamedPipeClientTransport(pipe);
+ else
+ trans = new TSocket(host, port);
+
+ // layered transport
if (buffered)
trans = new TBufferedTransport(trans as TStreamTransport);
if (framed)