Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^4: UDP server with IO::Socket::INET

by ikegami (Patriarch)
on Mar 03, 2010 at 15:42 UTC ( #826432=note: print w/replies, xml ) Need Help??

in reply to Re^3: UDP server with IO::Socket::INET
in thread UDP server with IO::Socket::INET

the server could remove them when the send fails

That won't work. The send won't fail if the receiver stops receiving. You need some explicit disconnection mechanism.

  • send doesn't wait for the datagram to be sent and acknowledged, so at best you'd know if a past send failed.
  • There's no connection to keep track of a past send failures.
  • There's no acknowledgment sent by the remote end to say it didn't fail.

The send will only fail if there's a local error (e.g. bad argument, no more resources, etc)

Kudos for IO::Socket::Multicast, though

Replies are listed 'Best First'.
Re^5: UDP server with IO::Socket::INET
by rowdog (Curate) on Mar 04, 2010 at 11:24 UTC

    If this was my project, I would definitely use an explicit disconnection.

    That said, ICMP does provide "Destination Unreachable" which could be used to detect clients that are MIA. Of course, using ICMP for this would be a lot of work for very little practical gain, which is why I recommended multicast.

      which is why I recommended multicast.

      Are you saying that multicast drops unreachable machines automatically?

        No, I'm saying that it is possible to detect missing clients with ICMP but a much better alternative would be an existing explicit connection protocol, such as multicast.

        Update: I realized too late that multicast doesn't actually use explicit connections but that's part of the beauty of multicast.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://826432]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2023-10-02 11:18 GMT
Find Nodes?
    Voting Booth?

    No recent polls found