aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/libraries/SledjHamr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libraries/SledjHamr.c')
-rw-r--r--src/libraries/SledjHamr.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libraries/SledjHamr.c b/src/libraries/SledjHamr.c
index 17b7610..26df012 100644
--- a/src/libraries/SledjHamr.c
+++ b/src/libraries/SledjHamr.c
@@ -32,16 +32,23 @@ static Eina_Bool _add(void *data, int type, Ecore_Con_Event_Server_Del *ev)
32 return ECORE_CALLBACK_RENEW; 32 return ECORE_CALLBACK_RENEW;
33} 33}
34 34
35static Eina_Bool _delTimer(void *data)
36{
37 struct _conct *this = data;
38
39 reachOut(this->address, this->port, this->pointer, this->addCb, this->dataCb, this->delCb);
40 return ECORE_CALLBACK_CANCEL;
41}
42
35static Eina_Bool _del(void *data, int type, Ecore_Con_Event_Server_Del *ev) 43static Eina_Bool _del(void *data, int type, Ecore_Con_Event_Server_Del *ev)
36{ 44{
37 struct _conct *this = data; 45 struct _conct *this = data;
38 46
39 printf("FAILED to connect to server %s:%d, trying again!\n", this->address, this->port); 47 printf("FAILED to connect to server %s:%d, trying again in a second!\n", this->address, this->port);
40 ecore_event_handler_del(this->add); 48 ecore_event_handler_del(this->add);
41 ecore_event_handler_del(this->del); 49 ecore_event_handler_del(this->del);
42 if (ev->server) ecore_con_server_del(ev->server); 50 if (ev->server) ecore_con_server_del(ev->server);
43 sleep(1); 51 ecore_timer_add(1.0, _delTimer, this);
44 reachOut(this->address, this->port, this->pointer, this->addCb, this->dataCb, this->delCb);
45 return ECORE_CALLBACK_CANCEL; 52 return ECORE_CALLBACK_CANCEL;
46} 53}
47 54