3 ms·
1) Optimizing for the most common use case. 2) You can create file descriptors not backed by any actual network connection or file on the harddrive (man 2 pipe
by wereHamster 12y ago
1) Optimizing for the most common use case. 2) You can create file descriptors not backed by any actual network connection or file on the harddrive (man 2 pipe and man 2 socketpair), you can still build an API on top of that which operates purely on buffers.
- amelius 12y ago> 1) Optimizing for the most common use case My compiler is most commonly used together with an editor. Still I'm glad it didn't come with an editor built-in :) > 2) You can create file descriptors not backed by any actual network connection or file on the harddrive Indeed. It doesn't mean it is the preferred way to do it, from a code-quality or even performance point of view.
- zAy0LfpBZLC8mAC 12y agoYes, you can, if your goal is massive bloat. If you want to have reasonable performance and scalability, a blocking API (that is to say, at least one OS thread per connection) and loads of IPC syscall overhead is about the worst thing you could do.
- zzzcpan 12y agoYou are wrong. Blocking socket I/O is rather uncommon in networking software.