[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] echo server, close after reply
hi,
this is probably trivial but i couldn't find a way of getting it done.
using the always popular echo server example from the docs i just want the
connection to close after sending the "echo". BEV_OPT_CLOSE_ON_FREE is set
already so i'd just add bufferevent_free(bev) after evbuffer_add_buffer(output,
input). however as you probably have guessed already no reply is sent then at
all.
i don't seem to be the only one wondering about this. i found two other guys
asking the same here
http://www.codedisqus.com/CzVjVXqXkX/how-to-close-socket-after-writing-in-libevent-with-bufferevents.html
and here
http://stackoverflow.com/questions/15995659/libevent-writes-to-the-socket-only-after-second-buffer-write.
both however without a reply.
so my simple question is: how can i send the reply and then close the
connection?
any hint is welcome and thanks in advance!
--
R-A-C
Götz T. Fischer CertIT&Comp
+49(0)7225/98 98 79
g.fischer@xxxxxxxx
r-a-c.de
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.