Q:

Sockets: Non-blocking shutdown(SHUT_WR)?

Is there a way to do shutdown(SHUT_WR) on socket asynchronously?
I.e. start the operation, then wait for its completion using poll?

A:

It's asynchronous anyway. It just queues a FIN behind the current contents of the socket send buffer, if any, which really just amounts to setting a bit somewhere. There's no poll() operation for completion of any send, let alone this one.

