how to terminate a client?

Hi all,

I've a server C++ program, from the server i want to maintain the Keep Alive. How to do this ?

From server program is there any way to terminate the Client connection? i've the socket Desc of that client. How to do this?


Thanks in advance
If I understand you correctly, why can't you just close() or shutdown() the file descriptor? This will cause the peer to see a broken pipe (assuming you are using TCP sockets). You will need to set
the SO_KEEPALIVE (IIRC) socket option (man setsockopt) so the peer sees the disconnect immediately, otherwise the peer won't see it until the peer attempts to send.


Topic archived. No new replies allowed.