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

[Libevent-users] avoiding file descriptor collisions



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) connection A opens a socket and receives fd N for a request
2) The request fails on the server and the server closes the TCP connection (sends a FIN) 3) the OS frees up fd N for the process, even though connection A hasn't closed it explicitly yet
4) connection B opens a socket and receives fd N
5) connection A runs its callback and closes fd N
6) B attempts to use fd N and errors out

Does this sound possible?  I'm running on x86_64 Linux kernel 2.6.38.

Thanks,
Myk
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.