Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-18 Thread Adrian Chadd
On Fri, Sep 18, 2009, Nick Mathewson wrote: > Right now most of the clue is in the reference book thing I've started > writing. The source for it is here, in Git: > git://git.torproject.org/~nickm/git/lebook.git Right. > I'm glad to apply patches or pull contributions from other people's >

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread Nick Mathewson
On Fri, Sep 18, 2009 at 11:09:52AM +0800, Adrian Chadd wrote: > On Thu, Sep 17, 2009, Nick Mathewson wrote: > > > > Nick, is this actually documented anywhere? > > > > Not that I recall, and it really ought to be. Anybody want to write the > > documentation patch? > > I've been threatening to

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread William Ahern
On Thu, Sep 17, 2009 at 07:51:58PM -0700, Gilad Benjamini wrote: > I just resolved a similar issue today, where I needed to close a file > descriptor AFTER deleting an event. > > My symptoms, though, were different. > > What underlying mechanism is your libevent using ? > > In my case it is epol

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread Clint Webb
I forgot to mention that I am using libevent-2.02alpha. I think it definately makes sence to free the event before closing the handle, but it just didn't occur to me before. On Fri, Sep 18, 2009 at 10:57 AM, Adrian Chadd wrote: > Well, the order of which you can do this depends on what the under

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread Adrian Chadd
On Thu, Sep 17, 2009, Nick Mathewson wrote: > > Nick, is this actually documented anywhere? > > Not that I recall, and it really ought to be. Anybody want to write the > documentation patch? I've been threatening to do this for ages. I may as well start now. Is there a project wiki or somethi

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread Nick Mathewson
On Fri, Sep 18, 2009 at 10:57:25AM +0800, Adrian Chadd wrote: > Well, the order of which you can do this depends on what the underlying OS > will > "do for you". > > I'd suggest sticking to "delete event, close socket" usage. Anything else > isn't portable. > > Nick, is this actually documented

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread Adrian Chadd
Well, the order of which you can do this depends on what the underlying OS will "do for you". I'd suggest sticking to "delete event, close socket" usage. Anything else isn't portable. Nick, is this actually documented anywhere? Adrian On Thu, Sep 17, 2009, Gilad Benjamini wrote: > I just reso

Re: [Libevent-users] Must delete events before closing the socket handle

2009-09-17 Thread Gilad Benjamini
I just resolved a similar issue today, where I needed to close a file descriptor AFTER deleting an event. My symptoms, though, were different. What underlying mechanism is your libevent using ? In my case it is epoll. With select or poll my scenario had no problems, in spite of the wrong order.