shutdown()
vs
SO_LINGER
l
You can use
shutdown{In|Out}put()
to find out
when the peer process has read all the
sent data.