mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 20:09:18 +02:00
* Handle EINTR for read/Write operations
git-svn-id: trunk@25341 -
This commit is contained in:
parent
1e48781694
commit
3dd8673212
@ -111,6 +111,7 @@ type
|
|||||||
Procedure StopAccepting;
|
Procedure StopAccepting;
|
||||||
Procedure SetNonBlocking;
|
Procedure SetNonBlocking;
|
||||||
Property Bound : Boolean Read FBound;
|
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 MaxConnections : longint Read FMaxConnections Write FMaxConnections;
|
||||||
Property QueueSize : Longint Read FQueueSize Write FQueueSize default 5;
|
Property QueueSize : Longint Read FQueueSize Write FQueueSize default 5;
|
||||||
Property OnConnect : TConnectEvent Read FOnConnect Write FOnConnect;
|
Property OnConnect : TConnectEvent Read FOnConnect Write FOnConnect;
|
||||||
@ -273,11 +274,17 @@ Var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Flags:=FReadFlags;
|
Flags:=FReadFlags;
|
||||||
Result:=fprecv(handle,@Buffer,count,flags);
|
{$ifdef unix}
|
||||||
If Result<0 then
|
Repeat
|
||||||
FLastError:=SocketError
|
{$endif}
|
||||||
else
|
Result:=fprecv(handle,@Buffer,count,flags);
|
||||||
FLastError:=0;
|
If Result<0 then
|
||||||
|
FLastError:=SocketError
|
||||||
|
else
|
||||||
|
FLastError:=0;
|
||||||
|
{$ifdef unix}
|
||||||
|
Until (FlastError<>ESysEINTR);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TSocketStream.Write (Const Buffer; Count : Longint) :Longint;
|
Function TSocketStream.Write (Const Buffer; Count : Longint) :Longint;
|
||||||
@ -287,11 +294,17 @@ Var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Flags:=FWriteFlags;
|
Flags:=FWriteFlags;
|
||||||
Result:=fpsend(handle,@Buffer,count,flags);
|
{$ifdef unix}
|
||||||
If Result<0 then
|
Repeat
|
||||||
FLastError:=SocketError
|
{$endif}
|
||||||
else
|
Result:=fpsend(handle,@Buffer,count,flags);
|
||||||
FlastError:=0;
|
If Result<0 then
|
||||||
|
FLastError:=SocketError
|
||||||
|
else
|
||||||
|
FlastError:=0;
|
||||||
|
{$ifdef unix}
|
||||||
|
Until (FlastError<>ESysEINTR);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSocketStream.GetLocalAddress: TSockAddr;
|
function TSocketStream.GetLocalAddress: TSockAddr;
|
||||||
|
Loading…
Reference in New Issue
Block a user