ecore_con: change Ecore.Con.Client to Efl.Network.Client.

Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3663

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Srivardhan Hebbar 2016-02-12 21:02:01 +01:00 committed by Cedric BAIL
parent 5af22ba27a
commit b1e1186b8e
10 changed files with 73 additions and 66 deletions

View File

@ -3,7 +3,7 @@
ecore_con_eolian_files = \ ecore_con_eolian_files = \
lib/ecore_con/ecore_con_base.eo \ lib/ecore_con/ecore_con_base.eo \
lib/ecore_con/ecore_con_client.eo \ lib/ecore_con/efl_network_client.eo \
lib/ecore_con/efl_network_server.eo \ lib/ecore_con/efl_network_server.eo \
lib/ecore_con/efl_network_connector.eo \ lib/ecore_con/efl_network_connector.eo \
lib/ecore_con/ecore_con_eet_base.eo \ lib/ecore_con/ecore_con_eet_base.eo \

View File

@ -1,5 +1,5 @@
#include "ecore_con_base.eo.h" #include "ecore_con_base.eo.h"
#include "efl_network_server.eo.h" #include "efl_network_server.eo.h"
#include "efl_network_connector.eo.h" #include "efl_network_connector.eo.h"
#include "ecore_con_client.eo.h" #include "efl_network_client.eo.h"
#include "efl_network_url.eo.h" #include "efl_network_url.eo.h"

View File

@ -6,7 +6,13 @@
#include "ecore_con_base.eo.legacy.h" #include "ecore_con_base.eo.legacy.h"
#include "efl_network_server.eo.legacy.h" #include "efl_network_server.eo.legacy.h"
#include "efl_network_connector.eo.legacy.h" #include "efl_network_connector.eo.legacy.h"
#include "ecore_con_client.eo.legacy.h" #include "efl_network_client.eo.legacy.h"
/********************************************************************
* ecore_con_client.eo.h
*******************************************************************/
typedef Eo Ecore_Con_Client;
/******************************************************************** /********************************************************************

View File

@ -124,7 +124,7 @@ int sd_fd_max = 0;
void void
_ecore_con_client_kill(Ecore_Con_Client *obj) _ecore_con_client_kill(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (cl->delete_me) if (cl->delete_me)
DBG("Multi kill request for client %p", cl); DBG("Multi kill request for client %p", cl);
else else
@ -807,7 +807,7 @@ ecore_con_client_send(Ecore_Con *obj, const void *data, int size)
} }
EOLIAN static int EOLIAN static int
_ecore_con_client_ecore_con_base_send(Eo *obj EINA_UNUSED, Ecore_Con_Client_Data *cl, const void *data, int size) _efl_network_client_ecore_con_base_send(Eo *obj EINA_UNUSED, Efl_Network_Client_Data *cl, const void *data, int size)
{ {
Efl_Network_Server_Data *host_server = NULL; Efl_Network_Server_Data *host_server = NULL;
EINA_SAFETY_ON_TRUE_RETURN_VAL(cl->delete_me, 0); EINA_SAFETY_ON_TRUE_RETURN_VAL(cl->delete_me, 0);
@ -820,7 +820,7 @@ _ecore_con_client_ecore_con_base_send(Eo *obj EINA_UNUSED, Ecore_Con_Client_Data
ecore_main_fd_handler_active_set(cl->fd_handler, ECORE_FD_READ | ECORE_FD_WRITE); ecore_main_fd_handler_active_set(cl->fd_handler, ECORE_FD_READ | ECORE_FD_WRITE);
if (cl->host_server) if (cl->host_server)
host_server = eo_data_scope_get(cl->host_server, ECORE_CON_CLIENT_CLASS); host_server = eo_data_scope_get(cl->host_server, EFL_NETWORK_CLIENT_CLASS);
if (cl->host_server && ((host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_UDP)) if (cl->host_server && ((host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_UDP))
@ -856,13 +856,13 @@ _ecore_con_client_ecore_con_base_send(Eo *obj EINA_UNUSED, Ecore_Con_Client_Data
} }
EOLIAN static Ecore_Con_Server * EOLIAN static Ecore_Con_Server *
_ecore_con_client_server_get(Eo *obj EINA_UNUSED, Ecore_Con_Client_Data *cl) _efl_network_client_server_get(Eo *obj EINA_UNUSED, Efl_Network_Client_Data *cl)
{ {
return cl->host_server; return cl->host_server;
} }
EOLIAN static Eina_Bool EOLIAN static Eina_Bool
_ecore_con_client_ecore_con_base_connected_get(Eo *obj EINA_UNUSED, Ecore_Con_Client_Data *cl) _efl_network_client_ecore_con_base_connected_get(Eo *obj EINA_UNUSED, Efl_Network_Client_Data *cl)
{ {
return !cl->delete_me; return !cl->delete_me;
} }
@ -875,7 +875,7 @@ ecore_con_client_connected_get(const Ecore_Con *obj)
} }
EOLIAN static void EOLIAN static void
_ecore_con_client_ecore_con_base_timeout_set(Eo *obj, Ecore_Con_Client_Data *cl, double timeout) _efl_network_client_ecore_con_base_timeout_set(Eo *obj, Efl_Network_Client_Data *cl, double timeout)
{ {
cl->disconnect_time = timeout; cl->disconnect_time = timeout;
@ -889,7 +889,7 @@ ecore_con_client_timeout_set(Ecore_Con *obj, double timeout)
} }
EOLIAN static double EOLIAN static double
_ecore_con_client_ecore_con_base_timeout_get(Eo *obj EINA_UNUSED, Ecore_Con_Client_Data *cl) _efl_network_client_ecore_con_base_timeout_get(Eo *obj EINA_UNUSED, Efl_Network_Client_Data *cl)
{ {
return cl->disconnect_time; return cl->disconnect_time;
} }
@ -905,7 +905,7 @@ EAPI void *
ecore_con_client_del(Ecore_Con_Client *obj) ecore_con_client_del(Ecore_Con_Client *obj)
{ {
if (!obj) return NULL; if (!obj) return NULL;
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (!cl) return NULL; if (!cl) return NULL;
#ifdef _WIN32 #ifdef _WIN32
@ -920,7 +920,7 @@ EAPI void
ecore_con_client_data_set(Ecore_Con_Client *obj, ecore_con_client_data_set(Ecore_Con_Client *obj,
const void *data) const void *data)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (!cl) if (!cl)
return; return;
@ -930,7 +930,7 @@ ecore_con_client_data_set(Ecore_Con_Client *obj,
EAPI void * EAPI void *
ecore_con_client_data_get(Ecore_Con_Client *obj) ecore_con_client_data_get(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (!cl) if (!cl)
return NULL; return NULL;
@ -938,7 +938,7 @@ ecore_con_client_data_get(Ecore_Con_Client *obj)
} }
EOLIAN static const char * EOLIAN static const char *
_ecore_con_client_ecore_con_base_ip_get(Eo *obj EINA_UNUSED, Ecore_Con_Client_Data *cl) _efl_network_client_ecore_con_base_ip_get(Eo *obj EINA_UNUSED, Efl_Network_Client_Data *cl)
{ {
if (!cl->ip) if (!cl->ip)
cl->ip = _ecore_con_pretty_ip(cl->client_addr); cl->ip = _ecore_con_pretty_ip(cl->client_addr);
@ -954,7 +954,7 @@ ecore_con_client_ip_get(const Ecore_Con *obj)
} }
EOLIAN static int EOLIAN static int
_ecore_con_client_ecore_con_base_port_get(Eo *obj EINA_UNUSED, Ecore_Con_Client_Data *cl) _efl_network_client_ecore_con_base_port_get(Eo *obj EINA_UNUSED, Efl_Network_Client_Data *cl)
{ {
Efl_Network_Server_Data *sd = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS); Efl_Network_Server_Data *sd = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS);
@ -982,7 +982,7 @@ ecore_con_client_port_get(const Ecore_Con *obj)
} }
EOLIAN static double EOLIAN static double
_ecore_con_client_ecore_con_base_uptime_get(Eo *obj EINA_UNUSED, Ecore_Con_Client_Data *cl) _efl_network_client_ecore_con_base_uptime_get(Eo *obj EINA_UNUSED, Efl_Network_Client_Data *cl)
{ {
return ecore_time_get() - cl->start_time; return ecore_time_get() - cl->start_time;
} }
@ -995,7 +995,7 @@ ecore_con_client_uptime_get(const Ecore_Con *obj)
} }
EOLIAN static void EOLIAN static void
_ecore_con_client_ecore_con_base_flush(Eo *obj, Ecore_Con_Client_Data *cl EINA_UNUSED) _efl_network_client_ecore_con_base_flush(Eo *obj, Efl_Network_Client_Data *cl EINA_UNUSED)
{ {
_ecore_con_client_flush(obj); _ecore_con_client_flush(obj);
} }
@ -1022,7 +1022,7 @@ _efl_network_server_ecore_con_base_fd_get(Eo *obj EINA_UNUSED, Efl_Network_Serve
} }
EOLIAN static int EOLIAN static int
_ecore_con_client_ecore_con_base_fd_get(Eo *obj EINA_UNUSED, Ecore_Con_Client_Data *cl) _efl_network_client_ecore_con_base_fd_get(Eo *obj EINA_UNUSED, Efl_Network_Client_Data *cl)
{ {
return ecore_main_fd_handler_fd_get(cl->fd_handler); return ecore_main_fd_handler_fd_get(cl->fd_handler);
} }
@ -1164,7 +1164,7 @@ ecore_con_event_server_data(Ecore_Con_Server *obj, unsigned char *buf, int num,
void void
ecore_con_event_client_add(Ecore_Con_Client *obj) ecore_con_event_client_add(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
Ecore_Con_Event_Client_Add *e; Ecore_Con_Event_Client_Add *e;
int ev = ECORE_CON_EVENT_CLIENT_ADD; int ev = ECORE_CON_EVENT_CLIENT_ADD;
@ -1188,7 +1188,7 @@ ecore_con_event_client_add(Ecore_Con_Client *obj)
void void
ecore_con_event_client_del(Ecore_Con_Client *obj) ecore_con_event_client_del(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
Ecore_Con_Event_Client_Del *e; Ecore_Con_Event_Client_Del *e;
if (!cl) return; if (!cl) return;
@ -1211,7 +1211,7 @@ ecore_con_event_client_del(Ecore_Con_Client *obj)
void void
ecore_con_event_client_write(Ecore_Con_Client *obj, int num) ecore_con_event_client_write(Ecore_Con_Client *obj, int num)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
Ecore_Con_Event_Client_Write *e; Ecore_Con_Event_Client_Write *e;
e = ecore_con_event_client_write_alloc(); e = ecore_con_event_client_write_alloc();
@ -1231,7 +1231,7 @@ ecore_con_event_client_write(Ecore_Con_Client *obj, int num)
void void
ecore_con_event_client_data(Ecore_Con_Client *obj, unsigned char *buf, int num, Eina_Bool duplicate) ecore_con_event_client_data(Ecore_Con_Client *obj, unsigned char *buf, int num, Eina_Bool duplicate)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
Ecore_Con_Event_Client_Data *e; Ecore_Con_Event_Client_Data *e;
e = ecore_con_event_client_data_alloc(); e = ecore_con_event_client_data_alloc();
@ -1296,7 +1296,7 @@ _ecore_con_event_server_error(Ecore_Con_Server *obj, char *error, Eina_Bool dupl
void void
ecore_con_event_client_error(Ecore_Con_Client *obj, const char *error) ecore_con_event_client_error(Ecore_Con_Client *obj, const char *error)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
Ecore_Con_Event_Client_Error *e; Ecore_Con_Event_Client_Error *e;
e = ecore_con_event_client_error_alloc(); e = ecore_con_event_client_error_alloc();
@ -1359,7 +1359,7 @@ _efl_network_server_eo_base_destructor(Eo *obj, Efl_Network_Server_Data *svr)
EINA_LIST_FREE(svr->clients, cl_obj) EINA_LIST_FREE(svr->clients, cl_obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(cl_obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(cl_obj, EFL_NETWORK_CLIENT_CLASS);
Ecore_Con_Event_Server_Add *ev; Ecore_Con_Event_Server_Add *ev;
/* some pointer hacks here to prevent double frees if people are being stupid */ /* some pointer hacks here to prevent double frees if people are being stupid */
@ -1409,7 +1409,7 @@ _ecore_con_client_free(Ecore_Con_Client *obj)
} }
EOLIAN static void EOLIAN static void
_ecore_con_client_eo_base_destructor(Eo *obj, Ecore_Con_Client_Data *cl) _efl_network_client_eo_base_destructor(Eo *obj, Efl_Network_Client_Data *cl)
{ {
double t_start, t; double t_start, t;
@ -1460,7 +1460,7 @@ _ecore_con_client_eo_base_destructor(Eo *obj, Ecore_Con_Client_Data *cl)
eina_stringshare_del(cl->ip); eina_stringshare_del(cl->ip);
cl->data = NULL; cl->data = NULL;
eo_do_super(obj, ECORE_CON_CLIENT_CLASS, eo_destructor()); eo_do_super(obj, EFL_NETWORK_CLIENT_CLASS, eo_destructor());
} }
static Eina_Bool static Eina_Bool
@ -1508,7 +1508,7 @@ _ecore_con_server_timer_update(Ecore_Con_Server *obj)
static Eina_Bool static Eina_Bool
_ecore_con_client_timer(Ecore_Con_Client *obj) _ecore_con_client_timer(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
ecore_con_client_del(obj); ecore_con_client_del(obj);
cl->until_deletion = NULL; cl->until_deletion = NULL;
@ -1518,7 +1518,7 @@ _ecore_con_client_timer(Ecore_Con_Client *obj)
static void static void
_ecore_con_cl_timer_update(Ecore_Con_Client *obj) _ecore_con_cl_timer_update(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (cl->disconnect_time) if (cl->disconnect_time)
{ {
if (cl->disconnect_time > 0) if (cl->disconnect_time > 0)
@ -2080,8 +2080,8 @@ _ecore_con_svr_tcp_handler(void *data,
/* a new client */ /* a new client */
obj = eo_add(ECORE_CON_CLIENT_CLASS, NULL); obj = eo_add(EFL_NETWORK_CLIENT_CLASS, NULL);
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (!cl) if (!cl)
{ {
ecore_con_event_server_error(svr_obj, "Memory allocation failure when attempting to add a new client"); ecore_con_event_server_error(svr_obj, "Memory allocation failure when attempting to add a new client");
@ -2355,8 +2355,8 @@ _ecore_con_svr_udp_handler(void *data,
} }
/* Create a new client for use in the client data event */ /* Create a new client for use in the client data event */
obj = eo_add(ECORE_CON_CLIENT_CLASS, NULL); obj = eo_add(EFL_NETWORK_CLIENT_CLASS, NULL);
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
EINA_SAFETY_ON_NULL_RETURN_VAL(cl, ECORE_CALLBACK_RENEW); EINA_SAFETY_ON_NULL_RETURN_VAL(cl, ECORE_CALLBACK_RENEW);
cl->host_server = svr_obj; cl->host_server = svr_obj;
@ -2382,7 +2382,7 @@ _ecore_con_svr_udp_handler(void *data,
static void static void
_ecore_con_svr_cl_read(Ecore_Con_Client *obj) _ecore_con_svr_cl_read(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
int num = 0; int num = 0;
Eina_Bool lost_client = EINA_TRUE; Eina_Bool lost_client = EINA_TRUE;
unsigned char buf[READBUFSIZ]; unsigned char buf[READBUFSIZ];
@ -2430,7 +2430,7 @@ _ecore_con_svr_cl_handler(void *data,
Ecore_Fd_Handler *fd_handler) Ecore_Fd_Handler *fd_handler)
{ {
Ecore_Con_Client *obj = data; Ecore_Con_Client *obj = data;
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (cl->delete_me) if (cl->delete_me)
return ECORE_CALLBACK_RENEW; return ECORE_CALLBACK_RENEW;
@ -2596,7 +2596,7 @@ _ecore_con_server_flush(Ecore_Con_Server *obj)
static void static void
_ecore_con_client_flush(Ecore_Con_Client *obj) _ecore_con_client_flush(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
int count = 0; int count = 0;
size_t num = 0; size_t num = 0;
@ -2677,7 +2677,7 @@ _ecore_con_event_client_add_free(Ecore_Con_Server *obj,
e = ev; e = ev;
if (e->client) if (e->client)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(e->client, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(e->client, EFL_NETWORK_CLIENT_CLASS);
Eina_Bool svrfreed = EINA_FALSE; Eina_Bool svrfreed = EINA_FALSE;
if ((svr) && (cl)) if ((svr) && (cl))
@ -2718,7 +2718,7 @@ _ecore_con_event_client_del_free(Ecore_Con_Server *obj,
e = ev; e = ev;
if (e->client) if (e->client)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(e->client, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(e->client, EFL_NETWORK_CLIENT_CLASS);
Eina_Bool svrfreed = EINA_FALSE; Eina_Bool svrfreed = EINA_FALSE;
if ((svr) && (cl)) if ((svr) && (cl))
@ -2755,7 +2755,7 @@ _ecore_con_event_client_write_free(Ecore_Con_Server *obj,
Efl_Network_Server_Data *svr = eo_data_scope_get(obj, EFL_NETWORK_SERVER_CLASS); Efl_Network_Server_Data *svr = eo_data_scope_get(obj, EFL_NETWORK_SERVER_CLASS);
if (e->client) if (e->client)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(e->client, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(e->client, EFL_NETWORK_CLIENT_CLASS);
Eina_Bool svrfreed = EINA_FALSE; Eina_Bool svrfreed = EINA_FALSE;
if ((svr) && (cl)) if ((svr) && (cl))
@ -2799,7 +2799,7 @@ _ecore_con_event_client_data_free(Ecore_Con_Server *obj,
e = ev; e = ev;
if (e->client) if (e->client)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(e->client, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(e->client, EFL_NETWORK_CLIENT_CLASS);
Eina_Bool svrfreed = EINA_FALSE; Eina_Bool svrfreed = EINA_FALSE;
if ((svr) && (cl)) if ((svr) && (cl))
@ -2951,7 +2951,7 @@ _ecore_con_event_client_error_free(Ecore_Con_Server *obj, Ecore_Con_Event_Client
Efl_Network_Server_Data *svr = eo_data_scope_get(obj, EFL_NETWORK_SERVER_CLASS); Efl_Network_Server_Data *svr = eo_data_scope_get(obj, EFL_NETWORK_SERVER_CLASS);
if (e->client) if (e->client)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(e->client, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(e->client, EFL_NETWORK_CLIENT_CLASS);
Eina_Bool svrfreed = EINA_FALSE; Eina_Bool svrfreed = EINA_FALSE;
if ((svr) && (cl)) if ((svr) && (cl))
@ -3002,6 +3002,6 @@ _ecore_con_lookup_done(void *data,
} }
#include "ecore_con_base.eo.c" #include "ecore_con_base.eo.c"
#include "ecore_con_client.eo.c" #include "efl_network_client.eo.c"
#include "efl_network_server.eo.c" #include "efl_network_server.eo.c"
#include "efl_network_connector.eo.c" #include "efl_network_connector.eo.c"

View File

@ -61,7 +61,7 @@ _ecore_con_dns_del(Ecore_Con_DNS *dns)
{ {
Efl_Network_Server_Data *svr; Efl_Network_Server_Data *svr;
svr = eo_data_scope_get(dns->svr, ECORE_CON_CLIENT_CLASS); svr = eo_data_scope_get(dns->svr, EFL_NETWORK_CLIENT_CLASS);
if ((svr) && (svr->infos)) if ((svr) && (svr->infos))
svr->infos = eina_list_remove(svr->infos, dns); svr->infos = eina_list_remove(svr->infos, dns);
} }

View File

@ -36,7 +36,7 @@ static Eina_Bool
_ecore_con_local_win32_server_read_client_handler(void *data, Ecore_Win32_Handler *wh) _ecore_con_local_win32_server_read_client_handler(void *data, Ecore_Win32_Handler *wh)
{ {
Ecore_Con_Client *obj = data; Ecore_Con_Client *obj = data;
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLAS);
void *buf; void *buf;
DWORD n; DWORD n;
Eina_Bool broken_pipe = EINA_FALSE; Eina_Bool broken_pipe = EINA_FALSE;
@ -89,7 +89,7 @@ static Eina_Bool
_ecore_con_local_win32_server_peek_client_handler(void *data, Ecore_Win32_Handler *wh) _ecore_con_local_win32_server_peek_client_handler(void *data, Ecore_Win32_Handler *wh)
{ {
Ecore_Con_Client *obj = data; Ecore_Con_Client *obj = data;
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLAS);
Efl_Network_Server_Data *host_svr = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS); Efl_Network_Server_Data *host_svr = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS);
#if 0 #if 0
char *msg; char *msg;
@ -235,7 +235,7 @@ static unsigned int __stdcall
_ecore_con_local_win32_server_read_client_thread(void *data) _ecore_con_local_win32_server_read_client_thread(void *data)
{ {
Ecore_Con_Client *obj = data; Ecore_Con_Client *obj = data;
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLAS);
Efl_Network_Server_Data *host_svr = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS); Efl_Network_Server_Data *host_svr = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS);
DWORD nbr_bytes = 0; DWORD nbr_bytes = 0;
@ -286,8 +286,8 @@ _ecore_con_local_win32_client_add(void *data, Ecore_Win32_Handler *wh)
(svr->client_count >= (unsigned int)svr->client_limit)) (svr->client_count >= (unsigned int)svr->client_limit))
return ECORE_CALLBACK_CANCEL; return ECORE_CALLBACK_CANCEL;
Ecore_Con_Client *cl_obj = eo_add(ECORE_CON_CLIENT_CLASS, NULL); Ecore_Con_Client *cl_obj = eo_add(EFL_NETWORK_CLIENT_CLAS, NULL);
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLAS);
if (!cl) if (!cl)
{ {
ERR("allocation failed"); ERR("allocation failed");
@ -506,7 +506,7 @@ ecore_con_local_win32_server_del(Ecore_Con_Server *obj)
void void
ecore_con_local_win32_client_del(Ecore_Con_Client *obj) ecore_con_local_win32_client_del(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLAS);
Efl_Network_Server_Data *svr = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS); Efl_Network_Server_Data *svr = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS);
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_ABSTRACT) if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_ABSTRACT)
@ -706,7 +706,7 @@ ecore_con_local_win32_server_flush(Ecore_Con_Server *obj)
Eina_Bool Eina_Bool
ecore_con_local_win32_client_flush(Ecore_Con_Client *obj) ecore_con_local_win32_client_flush(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLAS);
Ecore_Con_Type type; Ecore_Con_Type type;
size_t num; size_t num;
BOOL res; BOOL res;

View File

@ -95,7 +95,7 @@ typedef enum Ecore_Con_Proxy_State
ECORE_CON_PROXY_STATE_CONFIRM, ECORE_CON_PROXY_STATE_CONFIRM,
} Ecore_Con_Proxy_State; } Ecore_Con_Proxy_State;
struct _Ecore_Con_Client_Data struct _Efl_Network_Client_Data
{ {
#ifdef _WIN32 #ifdef _WIN32
SOCKET fd; SOCKET fd;
@ -127,7 +127,7 @@ struct _Ecore_Con_Client_Data
Eina_Bool delete_me : 1; /* del event has been queued */ Eina_Bool delete_me : 1; /* del event has been queued */
}; };
typedef struct _Ecore_Con_Client_Data Ecore_Con_Client_Data; typedef struct _Efl_Network_Client_Data Efl_Network_Client_Data;
struct _Efl_Network_Server_Data struct _Efl_Network_Server_Data
{ {

View File

@ -547,7 +547,7 @@ ecore_con_ssl_server_write(Ecore_Con_Server *svr,
Ecore_Con_Ssl_Error Ecore_Con_Ssl_Error
ecore_con_ssl_client_init(Ecore_Con_Client *obj) ecore_con_ssl_client_init(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (!cl) if (!cl)
return ECORE_CON_SSL_ERROR_NONE; return ECORE_CON_SSL_ERROR_NONE;
Efl_Network_Server_Data *host_server = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS); Efl_Network_Server_Data *host_server = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS);
@ -559,7 +559,7 @@ ecore_con_ssl_client_init(Ecore_Con_Client *obj)
Ecore_Con_Ssl_Error Ecore_Con_Ssl_Error
ecore_con_ssl_client_shutdown(Ecore_Con_Client *obj) ecore_con_ssl_client_shutdown(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (!cl) if (!cl)
return ECORE_CON_SSL_ERROR_NONE; return ECORE_CON_SSL_ERROR_NONE;
Efl_Network_Server_Data *host_server = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS); Efl_Network_Server_Data *host_server = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS);
@ -723,7 +723,7 @@ ecore_con_ssl_server_upgrade(Ecore_Con_Server *obj, Ecore_Con_Type ssl_type)
EAPI Eina_Bool EAPI Eina_Bool
ecore_con_ssl_client_upgrade(Ecore_Con_Client *obj, Ecore_Con_Type ssl_type) ecore_con_ssl_client_upgrade(Ecore_Con_Client *obj, Ecore_Con_Type ssl_type)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (!cl) if (!cl)
{ {
return EINA_FALSE; return EINA_FALSE;
@ -1144,7 +1144,7 @@ _ecore_con_ssl_server_write_gnutls(Ecore_Con_Server *obj,
static Ecore_Con_Ssl_Error static Ecore_Con_Ssl_Error
_ecore_con_ssl_client_init_gnutls(Ecore_Con_Client *obj) _ecore_con_ssl_client_init_gnutls(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
Efl_Network_Server_Data *host_server = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS); Efl_Network_Server_Data *host_server = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS);
const gnutls_datum_t *cert_list; const gnutls_datum_t *cert_list;
unsigned int iter, cert_list_size; unsigned int iter, cert_list_size;
@ -1286,7 +1286,7 @@ error:
static Ecore_Con_Ssl_Error static Ecore_Con_Ssl_Error
_ecore_con_ssl_client_shutdown_gnutls(Ecore_Con_Client *obj) _ecore_con_ssl_client_shutdown_gnutls(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (cl->session) if (cl->session)
{ {
gnutls_bye(cl->session, GNUTLS_SHUT_RDWR); gnutls_bye(cl->session, GNUTLS_SHUT_RDWR);
@ -1305,7 +1305,7 @@ _ecore_con_ssl_client_read_gnutls(Ecore_Con_Client *obj,
unsigned char *buf, unsigned char *buf,
int size) int size)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
int num; int num;
if (cl->ssl_state == ECORE_CON_SSL_STATE_HANDSHAKING) if (cl->ssl_state == ECORE_CON_SSL_STATE_HANDSHAKING)
@ -1341,7 +1341,7 @@ _ecore_con_ssl_client_write_gnutls(Ecore_Con_Client *obj,
const unsigned char *buf, const unsigned char *buf,
int size) int size)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
int num; int num;
if (cl->ssl_state == ECORE_CON_SSL_STATE_HANDSHAKING) if (cl->ssl_state == ECORE_CON_SSL_STATE_HANDSHAKING)
@ -1720,7 +1720,7 @@ _ecore_con_ssl_server_write_openssl(Ecore_Con_Server *obj,
static Ecore_Con_Ssl_Error static Ecore_Con_Ssl_Error
_ecore_con_ssl_client_init_openssl(Ecore_Con_Client *obj) _ecore_con_ssl_client_init_openssl(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
Efl_Network_Server_Data *host_server = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS); Efl_Network_Server_Data *host_server = eo_data_scope_get(cl->host_server, EFL_NETWORK_SERVER_CLASS);
int ret = -1; int ret = -1;
switch (cl->ssl_state) switch (cl->ssl_state)
@ -1788,7 +1788,7 @@ error:
static Ecore_Con_Ssl_Error static Ecore_Con_Ssl_Error
_ecore_con_ssl_client_shutdown_openssl(Ecore_Con_Client *obj) _ecore_con_ssl_client_shutdown_openssl(Ecore_Con_Client *obj)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
if (cl->ssl) if (cl->ssl)
{ {
if (!SSL_shutdown(cl->ssl)) if (!SSL_shutdown(cl->ssl))
@ -1808,7 +1808,7 @@ _ecore_con_ssl_client_read_openssl(Ecore_Con_Client *obj,
unsigned char *buf, unsigned char *buf,
int size) int size)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
int num; int num;
if (!cl->ssl) return -1; if (!cl->ssl) return -1;
@ -1839,7 +1839,7 @@ _ecore_con_ssl_client_write_openssl(Ecore_Con_Client *obj,
const unsigned char *buf, const unsigned char *buf,
int size) int size)
{ {
Ecore_Con_Client_Data *cl = eo_data_scope_get(obj, ECORE_CON_CLIENT_CLASS); Efl_Network_Client_Data *cl = eo_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
int num; int num;
num = SSL_write(cl->ssl, buf, size); num = SSL_write(cl->ssl, buf, size);

View File

@ -1,5 +1,6 @@
class Ecore.Con.Client (Ecore.Con.Base) { class Efl.Network.Client (Ecore.Con.Base) {
eo_prefix: ecore_con_client_obj; legacy_prefix: ecore_con_client;
eo_prefix: efl_network_client_obj;
methods { methods {
@property server { @property server {
[[Controls the server representing the socket the client has [[Controls the server representing the socket the client has

View File

@ -49,7 +49,7 @@ class Efl.Network.Server (Ecore.Con.Base) {
@property clients { @property clients {
[[Retrieves the current list of clients. [[Retrieves the current list of clients.
Each node in the returned list points to an \@ref Ecore_Con_Client. Each node in the returned list points to an \@ref Efl_Network_Client.
This list cannot be modified or freed. It can also change if new This list cannot be modified or freed. It can also change if new
clients are connected or disconnected, and will become invalid clients are connected or disconnected, and will become invalid
when the server is deleted/freed. when the server is deleted/freed.
@ -57,7 +57,7 @@ class Efl.Network.Server (Ecore.Con.Base) {
get { get {
} }
values { values {
// FIXME: Ecore.Con.Client is needed, but that introduces a cycle // FIXME: Efl.Network.Client is needed, but that introduces a cycle
clients: const(list<const(Ecore.Con.Base) *>) *; [[The list of clients on this server.]] clients: const(list<const(Ecore.Con.Base) *>) *; [[The list of clients on this server.]]
} }
} }