Re: [Libevent-users] avoiding file descriptor collisions

2011-12-15 Thread Myk Taylor
On 12/09/11 11:26, William Ahern wrote: A wild guess is that some code for connection Z (which predates A and B) holds a stale descriptor value and is closing it. This is a common bug in application code. Easiest way to avoid it is to never pass file descriptors as values--except to low-level rou

Re: [Libevent-users] avoiding file descriptor collisions

2011-12-12 Thread Myk Taylor
On 12/09/11 11:26, William Ahern wrote: No. Unfortunately, there's a bug in your application. A descriptor is always valid until an explicit close. However, under POSIX "the open() function shall return a file descriptor for the named file that is the lowest file descriptor not currently open fo

Re: [Libevent-users] avoiding file descriptor collisions

2011-12-09 Thread William Ahern
On Fri, Dec 09, 2011 at 07:21:44AM -0800, Myk Taylor wrote: > Hi all, > > I've run into another bit of trouble, but I don't see an easy way out > this time. The http(s) client I'm writing has many connections going up > and down continuously, and I'm running into what seem to be file > descrip

[Libevent-users] avoiding file descriptor collisions

2011-12-09 Thread Myk Taylor
Hi all, I've run into another bit of trouble, but I don't see an easy way out this time. The http(s) client I'm writing has many connections going up and down continuously, and I'm running into what seem to be file descriptor collisions in evhttp. I believe this is what is happening: 1) co