mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 18:21:00 +02:00
* make socket stuff compiling again. Package not 100% yet due to gtk1 dependencies.
git-svn-id: trunk@22953 -
This commit is contained in:
parent
cbbf87a58f
commit
7af086c05d
@ -113,16 +113,16 @@ var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
FFileName:=DebugSocket;
|
FFileName:=DebugSocket;
|
||||||
FSocket:=Socket(AF_UNIX,SOCK_STREAM,0);
|
FSocket:=FPSocket(AF_UNIX,SOCK_STREAM,0);
|
||||||
If FSocket<0 Then
|
If FSocket<0 Then
|
||||||
Raise Exception.Create(SErrSocketFailed);
|
Raise Exception.Create(SErrSocketFailed);
|
||||||
Flags:=fpFCntl(FSOCket,F_GETFL);
|
Flags:=fpFCntl(FSOCket,F_GETFL);
|
||||||
Flags:=Flags or O_NONBLOCK;
|
Flags:=Flags or O_NONBLOCK;
|
||||||
fpFCntl(FSocket,F_SETFL,Flags);
|
fpFCntl(FSocket,F_SETFL,Flags);
|
||||||
Str2UnixSockAddr(FFilename,FUnixAddr,AddrLen);
|
Str2UnixSockAddr(FFilename,FUnixAddr,AddrLen);
|
||||||
If Not Bind(FSocket,FUnixAddr,AddrLen) then
|
If FPBind(FSocket,@FUnixAddr,AddrLen)<>0 then
|
||||||
Raise Exception.CreateFmt(SErrBindFailed,[FFileName]);
|
Raise Exception.CreateFmt(SErrBindFailed,[FFileName]);
|
||||||
If Not (Listen(FSocket,5)) then
|
If (fpListen(FSocket,5)<>0) then
|
||||||
Raise Exception.CreateFmt(SErrListenFailed,[FSocket]);
|
Raise Exception.CreateFmt(SErrListenFailed,[FSocket]);
|
||||||
FClients:=TList.Create;
|
FClients:=TList.Create;
|
||||||
Accepting:=True;
|
Accepting:=True;
|
||||||
@ -162,7 +162,7 @@ var
|
|||||||
Quit : Boolean;
|
Quit : Boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FSocket:=Socket(AF_INET,SOCK_STREAM,0);
|
FSocket:=FPSocket(AF_INET,SOCK_STREAM,0);
|
||||||
If FSocket<0 Then
|
If FSocket<0 Then
|
||||||
Raise Exception.Create(SErrSocketFailed);
|
Raise Exception.Create(SErrSocketFailed);
|
||||||
Flags:=fpFCntl(FSocket,F_GETFL);
|
Flags:=fpFCntl(FSocket,F_GETFL);
|
||||||
@ -172,9 +172,9 @@ begin
|
|||||||
Writeln('Using port : ',APort);
|
Writeln('Using port : ',APort);
|
||||||
FInetAddr.Port := Swap(APort);
|
FInetAddr.Port := Swap(APort);
|
||||||
FInetAddr.Addr := 0;
|
FInetAddr.Addr := 0;
|
||||||
If Not Bind(FSocket,FInetAddr,SizeOf(FInetAddr)) then
|
If FPBind(FSocket,@FInetAddr,SizeOf(FInetAddr))<>0 then
|
||||||
Raise Exception.CreateFmt(SErrBindFailed,[FFileName]);
|
Raise Exception.CreateFmt(SErrBindFailed,[FFileName]);
|
||||||
If Not (Listen(FSocket,5)) then
|
If fpListen(FSocket,5)<>0 then
|
||||||
Raise Exception.CreateFmt(SErrListenFailed,[FSocket]);
|
Raise Exception.CreateFmt(SErrListenFailed,[FSocket]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -241,7 +241,7 @@ begin
|
|||||||
If Accepting then
|
If Accepting then
|
||||||
begin
|
begin
|
||||||
L:=SizeOf(ClientAddr);
|
L:=SizeOf(ClientAddr);
|
||||||
Result:=Accept(FSocket,ClientAddr,L);
|
Result:=fpAccept(FSocket,@ClientAddr,@L);
|
||||||
If (Result<0) Then
|
If (Result<0) Then
|
||||||
if (Errno<>ESYSEAgain) then
|
if (Errno<>ESYSEAgain) then
|
||||||
Raise Exception.CreateFmt(SErrAcceptFailed,[FSocket])
|
Raise Exception.CreateFmt(SErrAcceptFailed,[FSocket])
|
||||||
@ -280,7 +280,7 @@ end;
|
|||||||
Procedure CloseClientHandle(Handle : THandle);
|
Procedure CloseClientHandle(Handle : THandle);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
ShutDown(Handle,2);
|
fpShutDown(Handle,2);
|
||||||
FileClose(Handle);
|
FileClose(Handle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user