I tried looking through source but I cant navigate that much of a template code.
Basically: this is what documentation says (for close()
):
Remarks For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
I can do that manually, but if possible it would be nice to rely on RAII.
So if I have socket going out of scope do I need to call shutdown()
and close()
on it, or it will be done automatically?
shutdown
? (Seeman 2 shutdown
) It gracefully closes, say, a TCP connection and causes the other side to get an EOF. (As opposed to a "Connection reset by peer.")close
will release the socket regardless, and the resources will get freed, but one will transmit a clean close on the network. – Wilterdink