Re: [Libevent-users] Bufferevents and Evbuffers

2012-06-12 Thread Salim Moahmed
Thanks for your quick response, and I'll get back to you after trying your suggestion. Salem == On Tue, Jun 12, 2012 at 4:39 PM, Nick Mathewson wrote: > On Tue, Jun 12, 2012 at 10:25 AM, Salim Moahmed > wrote: > > How can I use the bufferevents to force the read buffer

Re: [Libevent-users] Bufferevents and Evbuffers

2012-06-12 Thread Nick Mathewson
On Tue, Jun 12, 2012 at 10:25 AM, Salim Moahmed wrote: > How can I use the bufferevents to force the read buffer to send its data > immediately to a write-buffer that will forward its data as it comes to > another socket? If I understand right, then you want to set up two bufferevents on two sock

Re: [Libevent-users] event_base_dispatch returning -1 - help debugging

2012-06-12 Thread Julian Bui
You're right, Dave, about the print statements. I accidentally pasted my code and then modified what was printed out. The else should read: else { cout << "event is not pending" << endl; } and this line of code always gets executed, despite it still getting triggered on incoming connection. I'll

Re: [Libevent-users] event_base_dispatch returning -1 - help debugging

2012-06-12 Thread Nick Mathewson
On Tue, Jun 12, 2012 at 3:09 PM, Dave Hart wrote: > On Tue, Jun 12, 2012 at 5:06 PM, Julian Bui wrote: >> Oh, one more thing.  I would really like to verify that there is indeed an >> event still pending - because I can at least restart the dispatch loop if >> there is an event pending.  But I ha

Re: [Libevent-users] event_base_dispatch returning -1 - help debugging

2012-06-12 Thread Nick Mathewson
On Tue, Jun 12, 2012 at 3:08 PM, Dave Hart wrote: > On Tue, Jun 12, 2012 at 4:47 PM, Julian Bui wrote: >> Thanks for the quick response, Nick. >> >>>  Step one might be to build with debugging support >> >> Ah, I didn't realize debugging required you to build with support for it. >> >> I am using

Re: [Libevent-users] event_base_dispatch returning -1 - help debugging

2012-06-12 Thread Dave Hart
On Tue, Jun 12, 2012 at 5:06 PM, Julian Bui wrote: > Oh, one more thing. I would really like to verify that there is indeed an > event still pending - because I can at least restart the dispatch loop if > there is an event pending. But I have not been able to correctly use > event_pending for so

Re: [Libevent-users] event_base_dispatch returning -1 - help debugging

2012-06-12 Thread Dave Hart
On Tue, Jun 12, 2012 at 4:47 PM, Julian Bui wrote: > Thanks for the quick response, Nick. > >> Step one might be to build with debugging support > > Ah, I didn't realize debugging required you to build with support for it. > > I am using windows and have built with just `nmake` in visual studio.

Re: [Libevent-users] event_base_dispatch returning -1 - help debugging

2012-06-12 Thread Julian Bui
Oh, one more thing. I would really like to verify that there is indeed an event still pending - because I can at least restart the dispatch loop if there is an event pending. But I have not been able to correctly use event_pending for some reason. My code is below and it always prints "event is

Re: [Libevent-users] event_base_dispatch returning -1 - help debugging

2012-06-12 Thread Julian Bui
Thanks for the quick response, Nick. > Step one might be to build with debugging support Ah, I didn't realize debugging required you to build with support for it. I am using windows and have built with just `nmake` in visual studio. What is the preferred method of building in windows? When I