Re:Beej's Guide to Unix Interprocess Communication
by prodigal_erik on Sunday December 06, 2009 @02:34AM
(#979300)
shutdown(2) lets you report EOF while still reading from a socket, so you can cleanly receive your peer's messages and EOF. Pipes only support close(2), so you can't report EOF without forcing your peer to handle SIGPIPE/EPIPE as well as ignoring anything else they want to send. And if your peer is writing and doesn't expect reads to work also (POSIX doesn't call for it), your own writes are just going to block and never be read.
[ Parent
| on HN ]
There are no comments on this comment yet.