THRIFT-1713 Named and Anonymous Pipe transport (Delphi)
Patch: Jens Geyer
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1400514 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/delphi/test/TestClient.pas b/lib/delphi/test/TestClient.pas
index d3a4895..baeaaa8 100644
--- a/lib/delphi/test/TestClient.pas
+++ b/lib/delphi/test/TestClient.pas
@@ -213,6 +213,13 @@
end;
end;
+ // In the anonymous pipes mode the client is launched by the test server
+ // -> behave nicely and allow for attaching a debugger to this process
+ if bAnonPipe and not IsDebuggerPresent
+ then MessageBox( 0, 'Attach Debugger and/or click OK to continue.',
+ 'Thrift TestClient (Delphi)',
+ MB_OK or MB_ICONEXCLAMATION);
+
SetLength( threads, FNumThread);
dtStart := Now;
diff --git a/lib/delphi/test/TestServer.pas b/lib/delphi/test/TestServer.pas
index 5d003da..7048a20 100644
--- a/lib/delphi/test/TestServer.pas
+++ b/lib/delphi/test/TestServer.pas
@@ -78,7 +78,7 @@
procedure SetServer( const AServer : IServer );
end;
- class procedure LaunchAnonPipeChild( const app : string; const transport : IPipeServer);
+ class procedure LaunchAnonPipeChild( const app : string; const transport : IAnonymousServerPipe);
class procedure Execute( const args: array of string);
end;
@@ -405,7 +405,7 @@
{ TTestServer }
-class procedure TTestServer.LaunchAnonPipeChild( const app : string; const transport : IPipeServer);
+class procedure TTestServer.LaunchAnonPipeChild( const app : string; const transport : IAnonymousServerPipe);
//Launch child process and pass R/W anonymous pipe handles on cmd line.
//This is a simple example and does not include elevation or other
//advanced features.
@@ -457,7 +457,8 @@
testProcessor : IProcessor;
ServerTrans : IServerTransport;
ServerEngine : IServer;
- pipeserver : IPipeServer;
+ anonymouspipe : IAnonymousServerPipe;
+ namedpipe : INamedServerPipe;
TransportFactory : ITransportFactory;
ProtocolFactory : IProtocolFactory;
i : Integer;
@@ -536,13 +537,13 @@
if sPipeName <> '' then begin
Console.WriteLine('- named pipe ('+sPipeName+')');
- pipeserver := TServerPipeImpl.Create( sPipeName);
- servertrans := pipeserver;
+ namedpipe := TNamedServerPipeImpl.Create( sPipeName);
+ servertrans := namedpipe;
end
else if AnonPipe then begin
Console.WriteLine('- anonymous pipes');
- pipeserver := TServerPipeImpl.Create;
- servertrans := pipeserver;
+ anonymouspipe := TAnonymousServerPipeImpl.Create;
+ servertrans := anonymouspipe;
end
else begin
Console.WriteLine('- sockets (port '+IntToStr(port)+')');
@@ -572,7 +573,7 @@
// start the client now when we have the anon handles, but before the server starts
if AnonPipe
- then LaunchAnonPipeChild( ExtractFilePath(ParamStr(0))+'client.exe', pipeserver);
+ then LaunchAnonPipeChild( ExtractFilePath(ParamStr(0))+'client.exe', anonymouspipe);
Console.WriteLine('');