[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



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, which it gets back from the server, and then calls
event_base_loopexit( base, NULL ); to get out.  However, the server's
event_cb isn't invoked:

http://pastebin.com/fzwpE1Wm

I compiled using:
g++ Test_libevent.cpp -o Test_libevent -levent_core -levent_pthreads
&& ./Test_libevent

so I apologize for any C++-isms that got in there.  I hope someone
more experienced than I can take a quick look and tell me what I'm
doing wrong - I hope it's something obvious/simple.

- Ken
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.