* Fix bug ID #28723

git-svn-id: trunk@33094 -
This commit is contained in:
michael 2016-02-13 11:47:17 +00:00
parent e8f2f42b75
commit 263c888555

View File

@ -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}
{ ---------------------------------------------------------------------