[fpc-pascal]linux Socket programming question with inetd as launcher

Fernando Lozano fsl at centroin.com.br
Thu Aug 15 14:41:43 CEST 2002


> I am trying to write a socket (client/server) communications.  I've
> decided to write the server simply by using the inetd.conf
> as a launcher and reading and writing to STDIN/OUT.
> Now : If I write my OWN programm with the socket unit and open a channel to
> the service running on say port 500 what port do I listen to and open to
> receive the answering connection?  Or how do I tell the inetd service im
> connecting
> to where I am listening?

These options are mutually exclusive: either you let inetd accept the connections and invoke your program, or your program binds to a port and listens itself for connections on it. The accept call returns the port number of the client in this case.

Inetd has no knowledge of your program if yo uuse the sockets unit, but if you use inetd your program has no knowledge of the remote port.

[]s, Fernando Lozano

More information about the fpc-pascal mailing list