[gnet] specifying the interface for gnet_mcast_socket_new



I need to open a listening multicast socket on a specific interface, so that 
the IGMP packets will originate out of only that interface. Currently, there 
does not seem to be a way to specify the interface when opening a mcast 
socket. (please correct me if I'm wrong). The IGMP packets will come out of 
only the first interface.

my current scheme...
	GMcastSocket* socket = gnet_mcast_socket_new();
	GInetAddr* group = gnet_inetaddr_new( "239.255.237.255", EDNET_PORT);
	gint status = gnet_mcast_socket_join_group( socket, group);

what I want to do...
	GInetAddr* interface = gnet_inetaddr_new( "192.168.2.1", 0);
	GMcastSocket* socket = gnet_mcast_socket_new_interface( interface);
	GInetAddr* group = gnet_inetaddr_new( "239.255.237.255", EDNET_PORT);
	gint status = gnet_mcast_socket_join_group( socket, group);

How can I accomplish this?

Thanks,
Shaun

(please cc my e-mail address, as I'm not a member of this mailing list)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]