setting a socket to multicast [ Solved, Mostly]

Brad Hards bhards at bigpond.net.au
Mon Nov 25 17:53:22 EST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 26 Nov 2002 08:16, Brad Hards wrote:
> On Mon, 25 Nov 2002 23:26, Adam Langley wrote:
> <snip>
>
> > From the ip(7) manpage:
> > 	IP_ADD_MEMBERSHIP: Join  a  multicast  group.  Argument  is  a  struct
> >               ip_mreqn structure.
> >
> > I don't think the Python setsockopt function is smart enough to see the
> > IP_ADD_MEMBERSHIP option and build the struct. I suggest you look into
> >    http://www.python.org/doc/current/lib/module-struct.html
> > and build a struct ip_mreqn
>
> Thanks - makes sense, but I'm not there yet. I think I'm creating the
> structure properly, but still no joy:
I found another example, at http://www.senux.com/linux/network/multicast/

The code seems very roundabout (trying to clean up and simplify now), but it
runs fine, and my toy mDNS server on LInux is getting messages from my iMac
over multicast :)

Brad

- --
http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE94qniW6pHgIdAuOMRAsPiAJ4swtiVSzDKXDrkK9vWVlyA4VoHzgCePpK6
45ThE0t3Z53R4EKPFAAcYwo=
=sUIh
-----END PGP SIGNATURE-----





More information about the Python-list mailing list