AF_UNIX shutdown

Corinna Vinschen
Mon Oct 19 11:48:30 GMT 2020

On Oct 16 08:55, Ken Brown via Cygwin-developers wrote:
> Hi Corinna,
> I'm about to add some code to handle shutdown info, and I want to make sure
> that I understand how this is supposed to work.
> fhandler_socket_unix::shutdown contains the following comment:
> /* Send shutdown info to peer.  Note that it's not necessarily fatal
>    if the info isn't sent here.  The info will be reproduced by any
>    followup package sent to the peer. */
> Does that mean that sendmsg should send its shutdown state as part of every
> packet it sends?

That was the idea.  The shutdown info is part of the package header in
af_unix_pkt_hdr_t, so every newly constructed follow up package contains
the shutdown info "for free".

> And I guess recvmsg should call grab_admin_pkg at every opportunity and
> should also check the shutdown state in every regular packet it reads?

That would make sense, I guess.


More information about the Cygwin-developers mailing list