diff options
author | David Walter Seikel | 2014-05-17 11:29:38 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-17 11:29:38 +1000 |
commit | 86525bd3660aa9afb4ddd4055c0aad5acc6c52d7 (patch) | |
tree | a0a129e6c3dd946992775655517f58b843d3d9db | |
parent | Adjust windows a bit. (diff) | |
download | SledjHamr-86525bd3660aa9afb4ddd4055c0aad5acc6c52d7.zip SledjHamr-86525bd3660aa9afb4ddd4055c0aad5acc6c52d7.tar.gz SledjHamr-86525bd3660aa9afb4ddd4055c0aad5acc6c52d7.tar.bz2 SledjHamr-86525bd3660aa9afb4ddd4055c0aad5acc6c52d7.tar.xz |
Wait a second before extantz tries to reconnect.
-rw-r--r-- | src/extantz/extantz.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index 80306b9..74a0c58 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c | |||
@@ -104,6 +104,17 @@ static Eina_Bool _data(void *data, int type, Ecore_Con_Event_Server_Data *ev) | |||
104 | return ECORE_CALLBACK_RENEW; | 104 | return ECORE_CALLBACK_RENEW; |
105 | } | 105 | } |
106 | 106 | ||
107 | // Forward declare a circular reference. | ||
108 | static Eina_Bool _del(void *data, int type, Ecore_Con_Event_Server_Del *ev); | ||
109 | |||
110 | static Eina_Bool _serverDelTimer(void *data) | ||
111 | { | ||
112 | globals *ourGlobals = data; | ||
113 | |||
114 | ourGlobals->server = reachOut("127.0.0.1", 8211 + 1, ourGlobals, (Ecore_Event_Handler_Cb) _add, (Ecore_Event_Handler_Cb) _data, (Ecore_Event_Handler_Cb) _del); | ||
115 | return ECORE_CALLBACK_CANCEL; | ||
116 | } | ||
117 | |||
107 | static Eina_Bool _del(void *data, int type, Ecore_Con_Event_Server_Del *ev) | 118 | static Eina_Bool _del(void *data, int type, Ecore_Con_Event_Server_Del *ev) |
108 | { | 119 | { |
109 | globals *ourGlobals = data; | 120 | globals *ourGlobals = data; |
@@ -115,7 +126,7 @@ static Eina_Bool _del(void *data, int type, Ecore_Con_Event_Server_Del *ev) | |||
115 | if (ourGlobals->running) | 126 | if (ourGlobals->running) |
116 | { | 127 | { |
117 | PW("Server dropped out, trying to reconnect."); | 128 | PW("Server dropped out, trying to reconnect."); |
118 | ourGlobals->server = reachOut("127.0.0.1", 8211 + 1, ourGlobals, (Ecore_Event_Handler_Cb) _add, (Ecore_Event_Handler_Cb) _data, (Ecore_Event_Handler_Cb) _del); | 129 | ecore_timer_add(1.0, _serverDelTimer, ourGlobals); |
119 | } | 130 | } |
120 | } | 131 | } |
121 | 132 | ||