Re: [fpc-pascal] Socket pair
On 03/10/16 12:00, Michael Van Canneyt wrote: On Mon, 3 Oct 2016, Santiago A. wrote: 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. What would be useful in that example would be extracting the IP address of the server, not just of the client. However when I look at the usage of Accept() I can't help but notice that it doesn't match what's described at the top of the page. http://www.freepascal.org/docs-html/current/rtl/sockets/fpaccept.html -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Socket pair
On 10/03/2016 03:27 AM, 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? Thanks for reminding me about a socket (and serial) echo example that I wrote for a work project six months ago. I'll try to release it here in the next day or two: http://ctrlterm.com/custom.htm Regards, Paul www.ControlPascal.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Socket pair
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. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Socket pair
On Mon, 3 Oct 2016, Rainer Stratmann wrote: There is fpaccept http://www.freepascal.org/docs-html/rtl/sockets/fpaccept.html But in the example accept is used ... (?!) Can you please report this in the bugtracker so I do not forget to correct this ? Michael. Am Montag, 3. Oktober 2016, 10:27:55 schrieb Santiago A.: 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? -- Saludos Santiago A. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Socket pair
There is fpaccept http://www.freepascal.org/docs-html/rtl/sockets/fpaccept.html But in the example accept is used ... (?!) Am Montag, 3. Oktober 2016, 10:27:55 schrieb Santiago A.: > 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? > > > -- > Saludos > Santiago A. > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Socket pair
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? -- Saludos Santiago A. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal