2 ms·
> How you handle a file no longer existing vs. a socket disconnection are not likely to be very similar. Why not? It seems that fopen(3) and fread(3) provide
by enriquto 4y ago
> How you handle a file no longer existing vs. a socket disconnection are not likely to be very similar.
Why not? It seems that fopen(3) and fread(3) provide the perfect abstraction for that. The semantics to remove(3) a file that is open are very clear, and they represent exactly what you want to happen when a connection is lost.
I never understood the need for "sockets" as a separate type of file. Why can't they be just be exposed as regular files?