[Libevent-users] Re: libevent 2.0.4: Segmentation fault with BEV_OPT_THREADSAFE set

2010-04-02 Thread Jarod Liu
Nerver mind. it's my fault. It need to include event2/thread.h and links event_pthreads to make it run On Fri, Apr 2, 2010 at 5:53 PM, Jarod Liu wrote: > My demo code works fine without the BEV_OPT_THREADSAFE option. > With the option segmentation fault  100% will happen. > &

[Libevent-users] libevent 2.0.4: Segmentation fault with BEV_OPT_THREADSAFE set

2010-04-02 Thread Jarod Liu
My demo code works fine without the BEV_OPT_THREADSAFE option. With the option segmentation fault 100% will happen. Maybe it is a platform specified problem, I see no one report before. = $ /usr/bin/c++ --version c++ (GCC) 4.1.2

[Libevent-users] evbuffer - how to read without draining data?

2010-03-31 Thread Jarod Liu
Hi, I writing a eventbuffer socket app. My app packet have a length header, I want to read data only when input buffer length > packet length(I need to read the length header first). But it seems like I can't read from evbuffer without draining data. Is there a way to do that? *

Re: [Libevent-users] how to flush output immediately?

2010-03-24 Thread Jarod Liu
All, Thank you. I'll try the callback way. On Thu, Mar 25, 2010 at 12:54 AM, Nick Mathewson wrote: > On Wed, Mar 24, 2010 at 11:24 AM, Jarod Liu wrote: >> I want to implement a server which listen on a port. When new >> connection come, write out something, then close the

[Libevent-users] how to flush output immediately?

2010-03-24 Thread Jarod Liu
I want to implement a server which listen on a port. When new connection come, write out something, then close the connection. I try use bufferevent_write put data to output buffer then bufferevent_free, but I found the connection close without flush output first. How can I do that with the buffere