4 ms·
Regarding your first point... You forget one thing: you open a file and get a file descriptor. If you open a socket (though it takes 3 calls), it also returns a
by joelhaasnoot 16y ago
Regarding your first point... You forget one thing: you open a file and get a file descriptor. If you open a socket (though it takes 3 calls), it also returns a file descriptor. Sockets can then be written to and read from just like files. Won't even get started then about the fact that sockets allow you to do just about any type of networking, and are very abstract by purpose, to allow a variety of uses.
- glhaynes 16y agoSounds like opening a socket could be reduced to one call, so why not fopen()? Seems like it'd be an easy thing to get into a kernel, any reason not to?
- joelhaasnoot 16y agoThe question is if fopen() would then still work with embedded or archaic architectures. Examples such as radio links on tiny 16-bit hardware come to mind.