[Libevent-users] evdns: How to quite event-loop

Tassilo von Parseval tassilo.von.parseval at rwth-aachen.de
Sun Nov 5 04:54:41 EST 2006


Hi there,

On adding the newly introduced DNS resolution to Event::Lib (a perl  
module around libevent), I can't seem to find a way to jump out of  
the mainloop once entered through event_dispatch().

Ordinarily, event_dispatch() would return when there are no more  
pending events. This however does not seem to be the case for  
evdns_resolve_*. So I introduced a counter keeping track of how many  
resolve-requests were added and how many served. When this counter  
dropped to zero, I called either evdns_clear_nameservers_and_suspend  
or evdns_shutdown, both to no avail: the first would segfault while  
the second tickled an assertion.

How can I make sure that an application doesn't get stuck in the  
mainloop when using libevent's DNS lookups?

Cheers,
Tassilo




More information about the Libevent-users mailing list