* make socket stuff compiling again. Package not 100% yet due to gtk1 dependencies.

git-svn-id: trunk@22953 -
This commit is contained in:
marco 2012-11-08 16:17:55 +00:00
parent cbbf87a58f
commit 7af086c05d

View File

@ -113,16 +113,16 @@ var
begin
FFileName:=DebugSocket;
FSocket:=Socket(AF_UNIX,SOCK_STREAM,0);
FSocket:=FPSocket(AF_UNIX,SOCK_STREAM,0);
If FSocket<0 Then
Raise Exception.Create(SErrSocketFailed);
Flags:=fpFCntl(FSOCket,F_GETFL);
Flags:=Flags or O_NONBLOCK;
fpFCntl(FSocket,F_SETFL,Flags);
Str2UnixSockAddr(FFilename,FUnixAddr,AddrLen);
If Not Bind(FSocket,FUnixAddr,AddrLen) then
If FPBind(FSocket,@FUnixAddr,AddrLen)<>0 then
Raise Exception.CreateFmt(SErrBindFailed,[FFileName]);
If Not (Listen(FSocket,5)) then
If (fpListen(FSocket,5)<>0) then
Raise Exception.CreateFmt(SErrListenFailed,[FSocket]);
FClients:=TList.Create;
Accepting:=True;
@ -162,7 +162,7 @@ var
Quit : Boolean;
begin
FSocket:=Socket(AF_INET,SOCK_STREAM,0);
FSocket:=FPSocket(AF_INET,SOCK_STREAM,0);
If FSocket<0 Then
Raise Exception.Create(SErrSocketFailed);
Flags:=fpFCntl(FSocket,F_GETFL);
@ -172,9 +172,9 @@ begin
Writeln('Using port : ',APort);
FInetAddr.Port := Swap(APort);
FInetAddr.Addr := 0;
If Not Bind(FSocket,FInetAddr,SizeOf(FInetAddr)) then
If FPBind(FSocket,@FInetAddr,SizeOf(FInetAddr))<>0 then
Raise Exception.CreateFmt(SErrBindFailed,[FFileName]);
If Not (Listen(FSocket,5)) then
If fpListen(FSocket,5)<>0 then
Raise Exception.CreateFmt(SErrListenFailed,[FSocket]);
end;
@ -241,7 +241,7 @@ begin
If Accepting then
begin
L:=SizeOf(ClientAddr);
Result:=Accept(FSocket,ClientAddr,L);
Result:=fpAccept(FSocket,@ClientAddr,@L);
If (Result<0) Then
if (Errno<>ESYSEAgain) then
Raise Exception.CreateFmt(SErrAcceptFailed,[FSocket])
@ -280,7 +280,7 @@ end;
Procedure CloseClientHandle(Handle : THandle);
begin
ShutDown(Handle,2);
fpShutDown(Handle,2);
FileClose(Handle);
end;