[fpc-pascal] the accept sample from the manual drives me crazy

Klaus Hartnegg hartnegg at gmx.de
Wed Sep 30 12:20:55 CEST 2015


Sorry, I meant accept, not access.

Am 30.09.2015 um 11:10 schrieb Klaus Hartnegg:
> http://www.freepascal.org/docs-html/rtl/sockets/fpaccept.html
>
> if Accept(S,FromName,Sin,Sout) then
> (* WARNING: Accept is deprecated *)
> (* ERROR: fromname contains nonsense characters *)

>    Sock2Text(S,Sin,Sout);
>    reset (Sin);
>    rwrite (Sout);
> then reset (Sin) crashes or hangs, and it also triggers a deprecated
> warning.

My conclusion from these two is that Accept and Sock2Text are more than 
deprecated, they are broken (in version 2.6.4 for Linux).

>    filedescr := fpaccept(S, @SAddr, @slen);

How can this filedescr be used other than with fpread?
Can it be implanted into a file of type "text"?
I would prefer to just readln from it.

Klaus



More information about the fpc-pascal mailing list