in reply to Problem with SO_REUSEPORT in IO::Socket::INET

dws++
and read Randal's Web Techniques Column 34 for some good insights.

--perlplexer
  • Comment on Re: Problem with SO_REUSEPORT in IO::Socket::INET

Replies are listed 'Best First'.
Re: Re: Problem with SO_REUSEPORT in IO::Socket::INET
by Aighearach (Initiate) on Apr 13, 2002 at 19:14 UTC
    Perhaps you could expand on what insights that provides, as he doesn't use IO::Socket in that article?
    --
    Snazzy tagline here
      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
        Thank you. :)

        Yes, I am trying to implement a preforking server, but what Randal does in the article is use a webserver library that uses.

        I would rather to not code it that way, and to use a single listen object, than to get away from using IO::Socket::INET for it. (because it needs to be accessible)
        --
        Snazzy tagline here