As the argument of accept()
for new client socket,
the listener socket is in shared memory area and is shared by all forked server processes.
but each server processesaccept()
returns the same socket descriptor after
accept()` is called by all different forked processes.
Does the fork()
also makes separate area for socket descriptors and each forked process
manage the area separately?
Is that why they produce duplicate socket descriptors?
I intended to use select()
to detect changes on all socket descriptors,
but because they produce all same descriptors, I couldn't make it out..