I use setsockopt with SO_RCVTIMEO option to set a timeout on my socket recv function. It works, but it instantly closes the socket when time is exceeded. I want to send a message before closing, is it possible ?
(My program have to work on Windows and Linux)
I have found a method : The socket do the recv() before closing, so I check if the socket recive "" and I can send my message. The socket closing be himself after that.