top | item 39087990

(no title)

greybrunix | 2 years ago

I think the point is that a socket is doing both reading and writing using the same file descriptor, which is counterintuitive.

discuss

order

Veserv|2 years ago

Which is a problem of their own making. If they use two sockets, which would be needed if all three programs were on different machines, then it would work exactly the same as the pipe example.

The problem is that they saw TCP sockets are two-way and then thought to optimize the TCP connection/state overhead by using it for double-duty without applying appropriate abstractions to transparently use a two-way channel as two one-way channels.

Gabrys1|2 years ago

Some early protocols used two sockets for (maybe?) roughly this reason

rnmmrnm|2 years ago

and that to half-close a socket you need to use some unintuitive syscall.

pif|2 years ago

Use two pipes and you won't need to half-close any socket.