* Handle EINTR for read/Write operations

git-svn-id: trunk@25341 -
This commit is contained in:
michael 2013-08-23 14:27:23 +00:00
parent 1e48781694
commit 3dd8673212

View File

@ -111,6 +111,7 @@ type
Procedure StopAccepting;
Procedure SetNonBlocking;
Property Bound : Boolean Read FBound;
// Maximium number of connections in total. *Not* the simultaneous connection count. -1 keeps accepting.
Property MaxConnections : longint Read FMaxConnections Write FMaxConnections;
Property QueueSize : Longint Read FQueueSize Write FQueueSize default 5;
Property OnConnect : TConnectEvent Read FOnConnect Write FOnConnect;
@ -273,11 +274,17 @@ Var
begin
Flags:=FReadFlags;
Result:=fprecv(handle,@Buffer,count,flags);
If Result<0 then
FLastError:=SocketError
else
FLastError:=0;
{$ifdef unix}
Repeat
{$endif}
Result:=fprecv(handle,@Buffer,count,flags);
If Result<0 then
FLastError:=SocketError
else
FLastError:=0;
{$ifdef unix}
Until (FlastError<>ESysEINTR);
{$ENDIF}
end;
Function TSocketStream.Write (Const Buffer; Count : Longint) :Longint;
@ -287,11 +294,17 @@ Var
begin
Flags:=FWriteFlags;
Result:=fpsend(handle,@Buffer,count,flags);
If Result<0 then
FLastError:=SocketError
else
FlastError:=0;
{$ifdef unix}
Repeat
{$endif}
Result:=fpsend(handle,@Buffer,count,flags);
If Result<0 then
FLastError:=SocketError
else
FlastError:=0;
{$ifdef unix}
Until (FlastError<>ESysEINTR);
{$ENDIF}
end;
function TSocketStream.GetLocalAddress: TSockAddr;