Re: [Libevent-users] Possible to use libevent to handle SIGTERM and SIGQUIT

2011-08-30 Thread Kun Xi
Yes, I just found out that I need to call event_add before start the message pump. Thanks. Kun On Tue, Aug 30, 2011 at 10:50 AM, Nick Mathewson wrote: > On Tue, Aug 30, 2011 at 1:46 PM, Kun Xi wrote: >> Hello, >> >> I just wondered whether libevent event loop can h

[Libevent-users] Possible to use libevent to handle SIGTERM and SIGQUIT

2011-08-30 Thread Kun Xi
Hello, I just wondered whether libevent event loop can handle the SIGTERM and SIGQUIT appropriately. Here is the code snippet I am trying to exit the message loop gracefully and brutally: static void quick_shutdown(evutil_socket_t _, short what, void* ctx) { struct event_base *evb = (struct

Re: [Libevent-users] message loop

2011-07-07 Thread Kun Xi
Are you talking about the win32 message loop or XLib messages? I doubt libevent support that as libevent mainly focuses on I/O. I remember Twisted can integrate its message loop with WxWindows message loop, you may take a look and get some ideas then. -Kun On Wed, Jul 6, 2011 at 4:20 PM, mosta

Re: [Libevent-users] How to limit http connections in libevent ?

2011-07-06 Thread Kun Xi
If you are trying to limit the connection only, you can maintain a internal counter for each process, and check current value during accept callback. On Sat, Jul 2, 2011 at 7:45 AM, Artyom Boyko wrote: > Hi! > I'm using libevent with N processes (i'm using fork). > > I need to limit connections/

Re: [Libevent-users] Visual C++ Projects

2011-06-30 Thread Kun Xi
I once played with libevent using cmake and msys. It is really fun: - free and familiar toolchain: gcc, gdb - portability - cross-compiling from linux host cmake can generate NMAKE makefile. I have never tried to use Visual C++. Each version of VS, msft changes the format, it requires you to u

[Libevent-users] When evhttp_connection_free should be called?

2011-06-23 Thread Kun Xi
connection in evhttp_request_new's callback. I found somebody asks the same question: http://archives.seul.org/libevent/users/Oct-2010/msg00060.html But nobody responds yet. Any suggestion is greatly appreciated. Thanks, Best regards, Kun Xi ***

[Libevent-users] Is bufferevent thread-safe?

2011-05-10 Thread Kun Xi
Hello, I am a new user of libevent, so the question may seem quite naive. I am building an application based on libevent-2.10 on linux using the epoll backend. The application maintains BST using tsearch, tdelete for access control. The tree is built from the command line argument, and looked up