3 ms·
TCP connections also have 2 file descriptors, they are just on different computers. It seems quite natural to me to think of a socket as two pipes joined togeth
by WJW 4y ago
TCP connections also have 2 file descriptors, they are just on different computers. It seems quite natural to me to think of a socket as two pipes joined together.
As with so many things in computing the abstraction leaks a bit when you get deeper into it but as a first intuition for beginners I think you could do way worse than "a socket is a bidirectional pipe to another computer".
I'm intrigued by your idea of making 2 file descriptors for each socket btw. Why would it be such an improvement in your opinion?