[fpc-pascal] why connect is "deprecated"

Marco van de Voort marcov at stack.nl
Tue Apr 16 11:53:32 CEST 2013


In our previous episode, Xiangrong Fang said:
> I am trying to write a tcp client (redis) in free pascal, and found this
> function marked as deprecated:
> 
> Function Connect(Sock:longint;const addr:TInetSockAddr;var
> SockIn,SockOut:text):Boolean; deprecated;

It was deprecated for two reasons:

1. the format, returntype and parameter typing is at 1.0.x level and was
never updated to 2.0
2. errorhandling is limited to non existent. It is mainly useful for small
 scripting stuff like logging on a local net. I wouldn't recommend doing 
 anything serious with it.

There was some discussion, and IIRC Daniel wanted to have a look at it, and
try to describe and improve errorhandling but that is still pending.
 
> My question is, why it is deprecated, or, what is the replacement for this
> function?

It is not recommended for use currently.



More information about the fpc-pascal mailing list