in reply to Re: IO::Socket::INET issues?
in thread IO::Socket::INET issues?

So what would be a valid check for an open UDP port? I cannot see an option or function in the module that would allow for this test.

Replies are listed 'Best First'.
Re^3: IO::Socket::INET issues?
by pg (Canon) on Jul 17, 2004 at 02:42 UTC

    The question is a bit vague. What are you try to check?

    • If you want to know whether the UDP socket is created successfully, then check the return code from new() is good enough. If it succeeds, it means that a local port has been picked, and a UDP socket is created.
    • If you want to check whether you can actually send packet, then send a packet, and see whether the peer receives it. If you want to see whether, it can receive, then let the peer send something.

    No magic here. By the way, UDP does not gurantee successful delivery, so even the packet is not received on either side, does not neccessarily to indicate a problem in your code.