[fpc-pascal] Thoughts on Shell Approach to TCP Sockets

Michael Van Canneyt michael at freepascal.org
Thu Mar 19 08:27:13 CET 2015

On Wed, 18 Mar 2015, Coyo Stormcaller wrote:

> Despite documentation and manuals, I have not figured out how to use TCP 
> sockets in Object Pascal, since there doesn't seem to be a primitive for it, 
> or any easy way to instantiate sockets and manipulate incoming connections.

There are at least 5 approaches that can do this for you.
- sockets unit - procedural, low-level approach to sockets.
- ssockets unit - object oriented layer for sockets.
- lnet - an async approach to sockets.
- synapse - a complete TCP/IP suite.
- Indy.

Regarding your overall approach:

If I may suggest, if you simply want to invoke a program with a socket as standard input,
you can just use (x)inetd, it comes by default on all unix installations, and does just that: 
it is started by init, manages TCP/IP connections and spawns off a program to handle the 
connection with the socket handle as standard input/output.

Why reinvent the wheel ?


More information about the fpc-pascal mailing list