in reply to Socket hang. (Windows or Perl? Solutions?) (Updated)

I replaced the deprecated Reuse with ReuseAddr, and I added Blocking => 0, to the IO::Socket::INET constructors.

FYI, on my Fedora system, there's a stack_size minimum of 16384.

Replies are listed 'Best First'.
Re^2: Socket hang. (Windows or Perl? Solutions?) (Updated)
by BrowserUk (Patriarch) on Apr 05, 2011 at 23:49 UTC
    I replaced the deprecated Reuse with ReuseAddr, and I added Blocking => 0, to the IO::Socket::INET constructors.

    You don't say what affect that had?

    Replacing Reuse with ReuseAddr shouldn't make any difference, as they are the same thing. Only the keyname changed.

    Setting blocking off might have some affect (on *nix), but is (or was: it might have changed in recent versions) a no-op on Windows. But in any case, the change would break the code as it is designed to use blocking reads and writes.

    FYI, on my Fedora system, there's a stack_size minimum of 16384.

    That appears to be a bug in the *nix implementation. The docs suggest that if you attempt to set it too low, it will be rounded up to the minimum: Some platforms have a minimum thread stack size. Trying to set the stack size below this value will result in a warning, and the minimum stack size will be used.

    I've removed it from the OP code.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.