DO NOT put something as important as the OS (and FPC version etc.) in your sig. As soon as you change your sig messages that you have already posted will be changed to track it, and in any event it does not show up when somebody tries to quote important context from your message- as I've just done.
You're using Arch. Fine, that's Linux. So it's the standard sockets API, and whataver the docs like to call it fpaccept() returns a standard handle (clue: it's an integer rather than a data structure).
Go to the documentation
https://www.freepascal.org/docs.html Go to RTL, Sockets unit... if you can't be bothered to scroll down there's an index link at the top. Go to Procedures and Functions hence fpaccept(). Make a note of the URL and raise a bug report against it, since the example refers to Accept() rather than fpaccept().
(Gawd, now you've got me felling grumpy about somebody else :-)
The basic problem is that the Accept() in that example is for associating standard Pascal textfiles with a socket, which might or might not be properly supported by current fpaccept() (I went through this from a different angle a few months ago, and somebody explained the detail).
This is from something recently worked on:
fClient := fpAccept(fSocket, @sockAddr, @sockLen); (* Blocking call *)
...
while true do begin
if fpRecv(fClient, @c, 1, 0) < 1 then
exit(-1);
if not (c in ['0'..'9']) then
break;
// fpSend(fClient, @star[1], 1, 0);
s += c
end;
That's a very small part of a Telnet server, showing the bit that accepts the connection plus a simple reader for a PIN from the client connecting. The fpsend() to echo stars was removed since it turned out to be more problem than it was worth, but I've left it in as an example to demonstrate that this is all standard Berkeley Sockets stuff.
Slightly later: The older relevant thread is
https://forum.lazarus.freepascal.org/index.php/topic,57706.0.html However unless you have a very good reason I would suggest sticking to the standard sockets API with the thin wrappers provided by the RTL, i.e. use fpsend() etc. rather than Write().
I've also recently been looking at intercepting the standard textfile devices so that a program can redirect its input and output textfiles via Telnet (i.e. act as a Telnet server) for debugging purposes. Discussion at
https://forum.lazarus.freepascal.org/index.php/topic,61418.0.html and I'll be posting it on Github presently.
MarkMLl