Re:Each socket should have two file descriptors
by theoh on Sunday July 21, 2013 @04:56PM
(#6080324)
Plan 9 doesn't separate the read and write fds, but does provide a separate ctl file to replace ioctl. This may be a cleaner approach: control signals are no longer "in band" operations on the data fd (or fds). Logically it seems better to have a single fd representing a full-duplex connection, and expecting the programmer to keep track of the connection state (or possibly receive an error if they don't)
This makes me long for a djb vs. Linus flamewar. Well, no, not really, because that would be counter-productive, but man, it'd sure be epic.
Re:Each socket should have two file descriptors
by aidenn0 on Monday July 22, 2013 @01:37PM
(#6085195)
Getting completely off topic now, but I would actually pay money to read the spectate that. We just need to find something they disagree about that they also both care enough about to rant at each other for.
djb's argument here is that TCP sockets are more like pipes, with separate read and write buffers, and separate read-side and write-side close operations. This makes sense, but what about UDP sockets? What about operations that apply to the socket as a whole, like bind(2), listen(2) or ioctl(2)?
[0] http://cr.yp.to/ucspi-tcp.html