audreyt / network-multicast

[Haskell] The "Network.Multicast" module is for sending UDP datagrams over multicast (class D) addresses.
http://github.com/audreyt/network-multicast
Other
23 stars 12 forks source link

multicastReceiver may fail with "addMembership: failed (Unknown error 4294967295)" #3

Open edsko opened 11 years ago

edsko commented 11 years ago

That error message isn't particularly informative :) (It particular, this happens when the network is disconnected.)

dcoutts commented 11 years ago

Note that this affects cloud haskell (the "simplelocalnet" backend uses network-multicast to find peers on the local network).

audreyt commented 11 years ago

4294967295 seems to be just an unsigned way to write -1 on a 32-bit platform. Would displaying -1 be slightly more helpful? :-)

Also, I assume this is 32-bit Linux? A sample step to reproduce this error would be much appreciated.

edsko commented 11 years ago

I have not encountered this in my own tests, but other people have (e..g. http://malcodigo.blogspot.ie/2012/10/using-cloud-haskell-in-hpc-cluster.html), so unfortunately I cannot give you a test case :-(

I was mostly just hoping that these errors could be clarified, perhaps using a call to strerror or some such.

joeyh commented 11 years ago

See #4, when this happens it also leaks a socket FD.

I can reproduce this easily on 32 bit Linux (Debian unstable). I just tell networkmanager to disconnect from the network, and then it always fails like this, since only the lo interface is up, which does not support multicast.

tdietert commented 7 years ago

This can happen when attempting to call multicastReceiver with a hostname that doesn't support multicast. For instance, I was attempting to use the hostname "0.0.0.0", when I should have been using "224.0.0.X". Also, as others have mentioned, you must make sure the network interface you are trying to use (e.g. eth0, or lo for local testing) has MULTICAST enabled (sometimes this is off by default). For local testing, make sure LOOPBACK is also enabled so that you can send and receive from the same port.

ocramz commented 7 years ago

@tdietert Thank you for the input; do you think there's a portable way to query network adapters for these flags from Haskell?