From: Evan S. <ev...@dr...> - 2007-04-03 13:52:18
|
On Apr 3, 2007, at 9:44 AM, Daniel Atallah wrote: > On 4/3/07, Mark Doliner <ma...@ki...> wrote: > Of course, it would be best if upnp and pmp are non-blocking and > Gaim could > talk to your router in the background shortly after startup while your > accounts are merrily logging in. > > The upnp stuff is non-blocking. The majority of upnp is non-blocking, but gaim_upnp_discover() says: > /* TODO: Non-blocking! */ > if((hp = gethostbyname(HTTPMU_HOST_ADDRESS)) == NULL) { and is called by gaim_upnp_get_public_ip() the first time it's used. The pmp stuff is blocking, though its blocking operations are specifically limited to 0.25 seconds in duration (pending being nonblocking, which I haven't done any work on yet but will look at eventually if someone - preferably someone who has actual experience writing nonblocking sockets code - doesn't beat me to it). For the record, I've never seen a significant delay as a result of either block of code... but I noticed that it was being done when I was working in network.c and was surprised that the public IP was determined long before it was ever needed and might never be used at all. -Evan |