Re: [gnet] mcast



On Mon, 2003-05-26 at 22:40, Nelio Pereira wrote:
> Hi list...
> 
> I want to use gnet to handle multicast messages. I
> have a few questions about it:
> 
> 1) Is there any way to integrate multicast sockets
> with GServer? It'd be easier to use mcast messages
> this way.

No, but I'd take a patch if you're interested in doing it.

> 2) I'm using mcast with GIOChannel, waiting for
> packets inside a main_loop. When I signal the
> application with SIGINT, I try to destroy the
> structures, and I make the following calls:
> 
> g_source_destroy(g_main_context_find_source_by_id(NULL,
> mcast_event_id));
> gnet_mcast_socket_leave_group(mcast_socket, mcast_ia);
> gnet_mcast_socket_delete(mcast_socket);
> 
> However, the second line blocks. It seems like there's
> still a thread running waiting for packets. How can I
> cleanly release all multicast resources?

What OS are you using?  I don't think leave_group should block.  It
calls setsockopt with IP_DROP_MEMBERSHIP, which shouldn't block.

BTW, I usually use g_source_remove.  I don't know what g_source_destroy
does...

David


-- 
David Helder - dhelder umich edu - http://www.eecs.umich.edu/~dhelder




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