THRIFT-3012 Timing problems in NamedPipe implementation due to unnecessary open/close
Client: Delphi
Patch: Jens Geyer
diff --git a/lib/delphi/src/Thrift.Transport.Pipes.pas b/lib/delphi/src/Thrift.Transport.Pipes.pas
index 48eb5e2..593bb3a 100644
--- a/lib/delphi/src/Thrift.Transport.Pipes.pas
+++ b/lib/delphi/src/Thrift.Transport.Pipes.pas
@@ -227,7 +227,7 @@
public
constructor Create( aPipename : string; aBufsize : Cardinal = 4096;
aMaxConns : Cardinal = PIPE_UNLIMITED_INSTANCES;
- aTimeOut : Cardinal = 0);
+ aTimeOut : Cardinal = INFINITE);
end;
@@ -816,10 +816,11 @@
overlapped := TOverlappedHelperImpl.Create;
ASSERT( not FConnected);
+ CreateNamedPipe;
while not FConnected do begin
- InternalClose;
- if QueryStopServer then Abort;
- CreateNamedPipe;
+
+ if QueryStopServer
+ then Abort;
if Assigned(fnAccepting)
then fnAccepting();