Re: [Libevent-users] What is the best way to detect a client socket disconnect?

2010-11-24 Thread Ken Feng
Hi Nick, That was >exactly< it - if I remove my bufferevent_free( bev ) from echo_event_cb() and call it when I intend to cut-off, the echo_event_cb() gets invoked. TYVM. - Ken On 11/25/10, Nick Mathewson wrote: > > FWICT, your code isn't really simulating a cutoff: the file descriptor > alloc

Re: [Libevent-users] What is the best way to detect a client socket disconnect?

2010-11-24 Thread Ken Feng
Hi Kevin, I appreciate the quick reply. After reading Nick's book, that's what I suspected, but I can't seem to get it to work. I essentially took Nick's TCP Client code, expanded it a bit to include an echo client, and started a server thread and a client thread. The client sends a hello world

[Libevent-users] What is the best way to detect a client socket disconnect?

2010-11-23 Thread Ken Feng
Within libevent, of course. As a point of reference, let's say we start up the TCP Echo server that is in Nick's book here: http://www.wangafu.net/~nickm/libevent-book/Ref8_listener.html I could handle a normal client shutdown by sending a special shutdown sequence from client to server, but what

[Libevent-users] event_debug_mode_too_late assignment in event.c subject to race conditions

2010-11-18 Thread Ken Feng
Hi, While running valgrind's drd on my app, I ran into a bunch of race conditions on the global variable event_debug_mode_too_late. The questionable assignment happens in a bunch of macros starting on event.c:195 in libevent-2.0.8-rc The two threads involved are a server thread and a client thre

[Libevent-users]

2010-11-17 Thread Ken Feng
Hi, I am a new user of libevent - I ran into the following valgrind error on my machine: Version: libevent-2.0.8-rc OS: Ubuntu 10.04 LTS amd64 Of interest is (bufferevent_sock.c:321) inside: struct bufferevent *bufferevent_socket_new() struct bufferevent_private *bufev_p; // ... if ((bufev_p =