[fpc-pascal] Socket pair

Michael Van Canneyt michael at freepascal.org
Mon Oct 3 13:55:40 CEST 2016



On Mon, 3 Oct 2016, Santiago A. wrote:

> I've seen that "accept" functions with socket pairs are deprecated. And
> fpsocketpair returns always -1.
>
> How do you get the in and out streams when a server  accepts a new
> client connection? I have seen some server examples, like isocksrv.pp,
> but only read from client and send nothing back to client.
>
> can anyone point and example with pair of sockets or bidirectional
> connection communication?

The same socket descriptor (stream, if you want) can be used for reading and
writing. The descriptor uses different buffers for read and write operations.

I will try to extend the sample programs so this is made more clear.

Michael.



More information about the fpc-pascal mailing list