What I need : a libevent client which tries to reconnect periodically after
loosing connection with the server.
To solve this problem I add evtimer that becomes active once the connection
with the server is lost. The evtimer callback calls
bufferevent_socket_connect(), but this function returns
What I need : a libevent client which tries to reconnect periodically after
loosing connection with the server.
To solve this problem I add evtimer that becomes active once the connection
with the server is lost. The evtimer callback calls
bufferevent_socket_connect(), but this function returns
It serms that this is not the way it should be done. The whole buffer event
should be removed and created again, until the server starts to respond.
Unfortunately this method causes a segmentation fault. I had no idea of how
such a simple problem can be solved with libevent. I couldn't be able t
Thanx Sashan for your answer. I did it in the way you pointed out, but the
application stops once the evtimer is on : segmentation fault.
Nick, this is how I did it :
1. create the bufferevent with bufferevent_socket_new()
2. set the callback with bufferevent_setcb()
3. enable the bufferevent f