Alright. From the code that you showed us, I see that you are trying to open multiple sockets listening on the same port. You can't do that even if you specify SO_REUSEPORT.
Here is why
...
For IP only one socket may be
bound to a specific local address/port pair. For TCP a
bound local socket endpoint (address/port pair) is
unavailable for some time after closing the socket, unless
the SO_REUSEADDR flag is set. Note that carelessly setting
SO_REUSEADDR might make TCP more unreliable unless PAWS is
used (see tcp(4)); the delay is needed to handle old pack-
ets still in the network.
...
He does not use IO::Socket, you are correct; however, he does show you how to implement a pre-forking server. That is what I was referring to when I posted that link.
--perlplexer |