Drop connection on timeout
Hello all,
I have a TCP server which does some sort of handshaking with client on connect().
after connect(), i force the client to send some key, if the key is not reached with in a time interval i want the server to drop the connection.
But the problem is that when is use recv() it will be blocking, so how to setup the timer that fires and closes the socket FD.
accept()
starttimer_thread() //spans a thread that checks for the rec flag
recv()
//on recv successfull, set flag
flag=1
|