mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 05:59:30 +02:00
parent
e8f2f42b75
commit
263c888555
@ -194,6 +194,7 @@ type
|
||||
Protected
|
||||
Procedure Bind; Override;
|
||||
Function Accept : Longint;override;
|
||||
function GetConnection: TSocketStream; override;
|
||||
Function SockToStream (ASocket : Longint) : TSocketStream;Override;
|
||||
Procedure Close; override;
|
||||
Public
|
||||
@ -509,11 +510,9 @@ Function TInetServer.GetConnection : TSocketStream;
|
||||
|
||||
var
|
||||
NewSocket : longint;
|
||||
l : integer;
|
||||
|
||||
begin
|
||||
Result:=Nil;
|
||||
L:=SizeOf(FAddr);
|
||||
NewSocket:=Accept;
|
||||
if (NewSocket<0) then
|
||||
Raise ESocketError.Create(seAcceptFailed,[Socket,SocketError]);
|
||||
@ -817,6 +816,22 @@ begin
|
||||
(Result as TUnixSocket).FFileName:=FFileName;
|
||||
end;
|
||||
|
||||
Function TUnixServer.GetConnection : TSocketStream;
|
||||
|
||||
var
|
||||
NewSocket : longint;
|
||||
|
||||
begin
|
||||
Result:=Nil;
|
||||
NewSocket:=Accept;
|
||||
if (NewSocket<0) then
|
||||
Raise ESocketError.Create(seAcceptFailed,[Socket,SocketError]);
|
||||
If FAccepting and DoConnectQuery(NewSocket) Then
|
||||
Result:=SockToStream(NewSocket)
|
||||
else
|
||||
CloseSocket(NewSocket);
|
||||
end;
|
||||
|
||||
{$endif}
|
||||
|
||||
{ ---------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user