In our previous episode, Xiangrong Fang said: > I am writing a redis client in fpc and found that even when the connection > is closed by server (via redis CLIENT KILL),
I don't know the redis protocol is, but "CLIENT KILL" sounds like redis protocol, while you are trying to detect disconnect at socket level. And is your socket layer really connection oriented ? IOW does the remote server really actively close the socket? Maybe stracing the application during a disconnect event might yield some more information. > How do I tell if a socket is still connected or not? Limit the timeout time (some socketoption or ioctl iirc, search the web), send something, and wait the timeout time. Then read something. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal