summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_ipc
diff options
context:
space:
mode:
authorcodewarrior <codewarrior>2006-03-30 14:01:04 +0000
committercodewarrior <codewarrior@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2006-03-30 14:01:04 +0000
commit214f4563a71a41354127660172e13d1f16941c28 (patch)
tree0add74420bbb7e5505e715fa351fcaf601834158 /legacy/ecore/src/lib/ecore_ipc
parentd6cd4313bde03bc2868432308be9673247cff8b8 (diff)
- maintain a list of connected clients and use that for clients_get
SVN revision: 21601
Diffstat (limited to 'legacy/ecore/src/lib/ecore_ipc')
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c17
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h1
2 files changed, 13 insertions, 5 deletions
diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
index 178f48b305..c7b2a7061f 100644
--- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
+++ b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
@@ -355,6 +355,8 @@ ecore_ipc_server_add(Ecore_Ipc_Type compl_type, const char *name, int port, cons
355 } 355 }
356 svr->max_buf_size = 32 * 1024; 356 svr->max_buf_size = 32 * 1024;
357 svr->data = (void *)data; 357 svr->data = (void *)data;
358 svr->client_list = ecore_list_new();
359 ecore_list_init(svr->client_list);
358 servers = _ecore_list2_append(servers, svr); 360 servers = _ecore_list2_append(servers, svr);
359 ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER); 361 ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER);
360 return svr; 362 return svr;
@@ -438,15 +440,14 @@ ecore_ipc_server_del(Ecore_Ipc_Server *svr)
438 if (svr->event_count > 0) 440 if (svr->event_count > 0)
439 svr->delete_me = 1; 441 svr->delete_me = 1;
440 else 442 else
441 { 443 {
442 Ecore_List2 *l;
443
444 ECORE_MAGIC_SET(svr, ECORE_MAGIC_NONE); 444 ECORE_MAGIC_SET(svr, ECORE_MAGIC_NONE);
445 while (svr->clients) 445 while (svr->clients)
446 ecore_ipc_client_del((Ecore_Ipc_Client *)svr->clients); 446 ecore_ipc_client_del((Ecore_Ipc_Client *)svr->clients);
447 ecore_con_server_del(svr->server); 447 ecore_con_server_del(svr->server);
448 servers = _ecore_list2_remove(servers, svr); 448 servers = _ecore_list2_remove(servers, svr);
449 if (svr->buf) free(svr->buf); 449 if (svr->buf) free(svr->buf);
450 ecore_list_destroy(svr->client_list);
450 free(svr); 451 free(svr);
451 } 452 }
452 return data; 453 return data;
@@ -503,7 +504,7 @@ ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr)
503 "ecore_ipc_server_clients_get"); 504 "ecore_ipc_server_clients_get");
504 return NULL; 505 return NULL;
505 } 506 }
506 return svr->clients; 507 return svr->client_list;
507} 508}
508 509
509#define SVENC(_member) \ 510#define SVENC(_member) \
@@ -971,6 +972,7 @@ _ecore_ipc_event_client_add(void *data __UNUSED__, int ev_type __UNUSED__, void
971 cl->max_buf_size = 32 * 1024; 972 cl->max_buf_size = 32 * 1024;
972 ecore_con_client_data_set(cl->client, (void *)cl); 973 ecore_con_client_data_set(cl->client, (void *)cl);
973 svr->clients = _ecore_list2_append(svr->clients, cl); 974 svr->clients = _ecore_list2_append(svr->clients, cl);
975 ecore_list_append(svr->client_list, cl);
974 { 976 {
975 Ecore_Ipc_Event_Client_Add *e2; 977 Ecore_Ipc_Event_Client_Add *e2;
976 978
@@ -1001,7 +1003,12 @@ _ecore_ipc_event_client_del(void *data __UNUSED__, int ev_type __UNUSED__, void
1001 cl = ecore_con_client_data_get(e->client); 1003 cl = ecore_con_client_data_get(e->client);
1002 { 1004 {
1003 Ecore_Ipc_Event_Client_Del *e2; 1005 Ecore_Ipc_Event_Client_Del *e2;
1004 1006 Ecore_Ipc_Server *svr;
1007
1008 svr = ecore_con_server_data_get(ecore_con_client_server_get(e->client));
1009 ecore_list_goto(svr->client_list, cl);
1010 ecore_list_remove(svr->client_list);
1011 ecore_list_goto_first(svr->client_list);
1005 e2 = calloc(1, sizeof(Ecore_Ipc_Event_Client_Del)); 1012 e2 = calloc(1, sizeof(Ecore_Ipc_Event_Client_Del));
1006 if (e2) 1013 if (e2)
1007 { 1014 {
diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h
index 8b5f59b55c..2eb6f98a3c 100644
--- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h
+++ b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h
@@ -59,6 +59,7 @@ struct _Ecore_Ipc_Server
59 ECORE_MAGIC; 59 ECORE_MAGIC;
60 Ecore_Con_Server *server; 60 Ecore_Con_Server *server;
61 Ecore_Ipc_Client *clients; 61 Ecore_Ipc_Client *clients;
62 Ecore_List *client_list;
62 void *data; 63 void *data;
63 unsigned char *buf; 64 unsigned char *buf;
64 int buf_size; 65 int buf_size;