Re: [gnet] mcast not receiving



I found the problem.
If I replace the call to gnet_mcast_socket_new() with
        GMcastSocket* socket = gnet_mcast_socket_port_new( EDNET_PORT);
it works. I thought the call to gnet_mcast_socket_join_group (which takes the 
UDP port) would set this.

Cheers,
Shaun

On October 3, 2001 12:55, David Helder wrote:
> If you modify examples/sdr.c to receive from your group, does that work?
>
> I think the ttl is high enough..
>
> David
>
> On Wed, 3 Oct 2001, Shaun Jackman wrote:
> > 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]
> > _______________________________________________
> > gnet mailing list
> > gnet gnetlibrary org
> > http://www.gnetlibrary.org/mailman/listinfo/gnet



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