in reply to getsockname() blocks indefinitely?

I don't see a getsockaddr, Do you mean getsockname? I can't think of a reason for that to block (should just be a call to get some local state from the kernel).

But it's not unusual for code to do a gethostbyaddr after calling getsockname, which would do a name resolution (DNS, but perhaps also WINS etc on Windows). This could block for a while (but not indefinitely i think).

Could it be that? Could you check your name resolution on the box you're on and in particular, can you reverse lookup all your local IPs?

Can you run a network sniffer and see if your box is generating any lookup traffic (DNS, port 53 - not sure about WINS etc).

Replies are listed 'Best First'.
Re^2: getsockaddr() blocks indefinitely?
by BrowserUk (Patriarch) on Nov 15, 2007 at 16:02 UTC
    Do you mean getsockname?

    Indeed I do, thanks. I've spent too long staring at the opening line in getsockname which reads Returns the packed sockaddr address of this end of the SOCKET connection, ... trying to work out what that meant!

    I'm trying to trace the call into the perl sources, and the name resolution thing loooks like a likely candidate. Thanks.


    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.