[fpc-pascal] How to detect connection status of a socket
Xiangrong Fang
xrfang at gmail.com
Mon Apr 22 14:23:30 CEST 2013
Hi All,
I am writing a redis client in fpc and found that even when the connection
is closed by server (via redis CLIENT KILL), send and receive can still be
done without error. i.e.:
- fpsend returns the number of bytes sent
- fprecv returns 0 (but NOT -1, which indicate a "detectable" error, as per
the document)
I also checked socketerror after send/recv, no error is reported.
How do I tell if a socket is still connected or not?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130422/83067166/attachment.html>
More information about the fpc-pascal
mailing list