Please use one of the macros rather than `2`. e.g., `SHUT_RD`, `SHUT_WR` or `SHUT_RDWR`.

Is there a good reason to use `shutdown` rather than `close`?

You should check the return value of `shutdown`.