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

Re: Re : [Libevent-users] libevent client tries to reconnect to a lost server






On Tue, Jan 15, 2013 at 9:52 AM, <ssod@xxxxxxx> wrote:
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 to find an example.
Â
I wouldn't say that .... I've used libevent in two programs and managed to reconnect to the server if a disconnection happens after the initial connect. I did this by setting up a timer event that was on while the client was disconnected and off while the client was connected or a connection was in progress. This works fine.