[gnet] mcast



Hi

I try to create a mcast group. I've read sdr.c code and i can connect
to a mcast group (at leat sap.mcast.net). But I want to create my own
mcast group, I don't success to do it. Someone may help me or give me
a code example ?

for now, my code server is :

ia = gnet_inetaddr_new("my.mcast.host", 9999);
g_assert(ia != NULL);

ms = gnet_mcast_socket_inetaddr_new(ia);
g_assert(ms != NULL);

rv = gnet_mcast_socket_set_loopback(ms, 0);
g_assert(rv == 0);



and my client code is :

ms = gnet_mcast_socket_port_new(9999);
g_assert(ms != NULL);

ia = gnet_inetaddr_new("my.mcast.host", 9999);
g_assert(ia != NULL);

rv = gnet_mcast_socket_join_group(ms, ia);
g_assert(rv == 0);

rv = gnet_mcast_socket_set_loopback(ms, 0);
g_assert(rv == 0);



I call server, the program that create the mcast group.
I call client, the program that join to a mcast group.

The problem is here :
rv = gnet_mcast_socket_join_group(ms, ia);
g_assert(rv == 0);

I have :
** ERROR **: file mcast_client.c: line 37 (main): assertion failed: (rv == 0)


I think, that (what I call) the server isn't good. But how to
do a good one ?


thanks
philippe




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