[gnet] mcast not receiving



I set up a mcast receive socket, but it doesn't seem to be receiving!
I'm not sure where to start troubleshooting. The code's not long so I've 
attached the pertinent bit at the end of this e-mail. I ran tcpdump to make 
sure the packet is going out on the wire, and it seems to have made it there 
just fine. I traced it with gdb and it blocks in the call to 
gnet_mcast_socket_receive. Any idea why it's not receiving?

$ tcpdump -ei eth1
12:00:47.540261 0:1:2:c3:fd:8a 1:0:5e:7f:ed:ff ip 60: 192.168.0.3.35477 > 
239.255.237.255.3792:  udp 16 (DF) [ttl 1]

Thanks,
Shaun

[begin code]
int
main( int argc, char* argv[])
{
	// init
	GMcastSocket* socket = gnet_mcast_socket_new();
	g_assert( socket);
	GInetAddr* group = gnet_inetaddr_new( "239.255.237.255", EDNET_PORT);
	g_assert( group);
	gint status = gnet_mcast_socket_join_group( socket, group);
	g_assert( !status);
	gint8 buf[ 1024];
	GUdpPacket* packet = gnet_udp_packet_receive_new( buf, sizeof( buf));
	g_assert( packet);

	// rx
	for(;;) {
		gint len = gnet_mcast_socket_receive( socket, packet);
		if( len == -1)
			continue;
		cout << "Received " << len << " bytes." << endl;
	}

	// cleanup
	gnet_mcast_socket_leave_group( socket, group);
	return 0;
}
[end code]



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