aboutsummaryrefslogtreecommitdiff
path: root/src/espik_net.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/espik_net.c')
-rw-r--r--src/espik_net.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/espik_net.c b/src/espik_net.c
index 8057ae0..ee271c1 100644
--- a/src/espik_net.c
+++ b/src/espik_net.c
@@ -19,7 +19,13 @@ Ecore_Con_Server* con_sock;
void espik_con_init (t_info serv_info)
{
- ecore_con_init ();
+ int nb_launch;
+
+ nb_launch = ecore_con_init ();
+
+#if _ESPIK_DEBUG_
+ printf ("espik_con_init: nb_launch = %d\n", nb_launch);
+#endif
con_sock = ecore_con_server_connect (ECORE_CON_REMOTE_SYSTEM,
serv_info.server->host, (int)serv_info.server->port, NULL);
@@ -29,8 +35,12 @@ void espik_con_init (t_info serv_info)
exit (-1);
}
- ecore_event_handler_add (ECORE_CON_EVENT_SERVER_DATA,
- (Handler_Func) server_data, NULL);
+ if (! (ecore_event_handler_add (ECORE_CON_EVENT_SERVER_DATA,
+ (Handler_Func) server_data, NULL)))
+ {
+ fprintf (stderr, "ecore_event_handler_add failed at espik_con_init\n");
+ exit (-1);
+ }
}
void espik_con_shutdown ()
@@ -38,6 +48,7 @@ void espik_con_shutdown ()
#if _ESPIK_DEBUG_
printf ("> espik_con_shutdown\n");
#endif
+
ecore_con_server_del (con_sock);
ecore_con_shutdown ();
@@ -51,6 +62,7 @@ void espik_raw_send (char *msg)
{
int len;
char* out;
+ int ret; /* FIXME: DEL THAT ! */
len = strlen (msg) + 3;
@@ -67,9 +79,10 @@ void espik_raw_send (char *msg)
printf ("out[len-1]: 0x%X\n", out[len - 1]);
*/
+ ret = ecore_con_server_send (con_sock, out, strlen (out));
+
#if _ESPIK_DEBUG_
- printf ("ecore_con_server_send: %d\n", ecore_con_server_send (con_sock,
- out, strlen (out)));
+ printf ("ecore_con_server_send: %d\n", ret);
#endif
free (out);