[fpc-pascal] Changes in sockets unit

Marco van de Voort marcov at stack.nl
Tue Jan 27 14:03:08 CET 2009


In our previous episode, leledumbo said:
> I saw many deprecated things in sockets unit. Could someone tell me what to
> do to port existing code?

All the code was already deprecated since 2.0, but the "deprecate" function
was only new in 2.2.0, and 2.2.0 had to be 2.0.4 compilable.

Use the fp* versions of the functions as much as possible. They have
standard errorhandling like documented by e.g. manpages. The older functions
had their own conventions related to 1.0.x Linux unit behaviour, which is
why they were deprecated. Since they don't hurt that bad it was decided to
not remove them directly, but have a reasonable grace period.

However 2.0.0 is now almost 4 years ago, and in 2.4 they will be removed.

> Why are Sock2Text and Text2Sock deprecated? You know, they're very handy
> (sometimes).

The errorhandling related to their use can be cumbersome, which makes them
handy for little stuff but hard to support. Moreover, nobody was interested
to maintain them. (though inbetween afaik Daniel worked on it a bit to keep
them working).




More information about the fpc-pascal mailing list