diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/espik_net.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/espik_net.c b/src/espik_net.c index adfddeb..2708542 100644 --- a/src/espik_net.c +++ b/src/espik_net.c @@ -18,51 +18,51 @@ Ecore_Con_Server* con_sock; void espik_con_init (t_info serv_info) { - ecore_con_init (); - - con_sock = ecore_con_server_connect (ECORE_CON_REMOTE_SYSTEM, - serv_info.server->host, (int)serv_info.server->port, NULL); - if (!con_sock) - { - fprintf (stderr, "ecore_con_server_connect failed\n"); - exit (-1); - } - - ecore_event_handler_add (ECORE_CON_EVENT_SERVER_DATA, - (Handler_Func) server_data, NULL); + ecore_con_init (); + + con_sock = ecore_con_server_connect (ECORE_CON_REMOTE_SYSTEM, + serv_info.server->host, (int)serv_info.server->port, NULL); + if (!con_sock) + { + fprintf (stderr, "ecore_con_server_connect failed\n"); + exit (-1); + } + + ecore_event_handler_add (ECORE_CON_EVENT_SERVER_DATA, + (Handler_Func) server_data, NULL); } void espik_con_shutdown () { - printf ("> espik_con_shutdown\n"); - ecore_con_server_del (con_sock); - ecore_con_shutdown (); + printf ("> espik_con_shutdown\n"); + ecore_con_server_del (con_sock); + ecore_con_shutdown (); - printf ("< espik_con_shutdown\n"); -/* ecore_main_loop_quit (); */ + printf ("< espik_con_shutdown\n"); + /* ecore_main_loop_quit (); */ } void espik_raw_send (char *msg) { - int len; - char* out; + int len; + char* out; - len = strlen (msg) + 3; + len = strlen (msg) + 3; out = malloc (sizeof (char) * len); - snprintf (out, len, "%s\r\n", msg); + snprintf (out, len, "%s\r\n", msg); - printf ("espik_raw_send:\nmsg: %s\nout: %s\n", msg, out); -/* - printf ("out[len-3]: 0x%X\n", out[len - 3]); - printf ("out[len-2]: 0x%X\n", out[len - 2]); - printf ("out[len-1]: 0x%X\n", out[len - 1]); -*/ + printf ("espik_raw_send:\nmsg: %s\nout: %s\n", msg, out); + /* + printf ("out[len-3]: 0x%X\n", out[len - 3]); + printf ("out[len-2]: 0x%X\n", out[len - 2]); + printf ("out[len-1]: 0x%X\n", out[len - 1]); + */ - printf ("ecore_con_server_send: %d\n", ecore_con_server_send (con_sock, + printf ("ecore_con_server_send: %d\n", ecore_con_server_send (con_sock, out, strlen (out))); - free (out); + free (out); } |