summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_ipc
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-04-29 04:58:55 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-04-29 04:58:55 +0000
commit5b1003cb541573ef2527bf60c1d97c11921dc43a (patch)
tree67b159c9a4dfdb390447ec691a906361c178221d /legacy/ecore/src/lib/ecore_ipc
parent4eb5ded2acc6f54365a880bb6f76cf6cb0efec3c (diff)
mirror changes in ipc as with con
SVN revision: 14468
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h3
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c42
2 files changed, 40 insertions, 5 deletions
diff --git a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
index 3926bb5b55..6bfd51278e 100644
--- a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
+++ b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
@@ -288,7 +288,8 @@ extern "C" {
288 EAPI int ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr); 288 EAPI int ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr);
289 /* FIXME: this needs to become an ipc message */ 289 /* FIXME: this needs to become an ipc message */
290 EAPI int ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, int minor, int ref, int ref_to, int response, void *data, int size); 290 EAPI int ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, int minor, int ref, int ref_to, int response, void *data, int size);
291 291 EAPI void ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, char reject_excess_clients);
292
292 /* FIXME: this needs to become an ipc message */ 293 /* FIXME: this needs to become an ipc message */
293 EAPI int ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int ref_to, int response, void *data, int size); 294 EAPI int ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int ref_to, int response, void *data, int size);
294 EAPI Ecore_Ipc_Server *ecore_ipc_client_server_get(Ecore_Ipc_Client *cl); 295 EAPI Ecore_Ipc_Server *ecore_ipc_client_server_get(Ecore_Ipc_Client *cl);
diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
index 4d51f121b1..37ee911bc4 100644
--- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
+++ b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
@@ -554,6 +554,40 @@ ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, int minor, int ref, int
554 return ret; 554 return ret;
555} 555}
556 556
557/**
558 * Sets a limit on the number of clients that can be handled concurrently
559 * by the given server, and a policy on what to do if excess clients try to
560 * connect.
561 * Beware that if you set this once ecore is already running, you may
562 * already have pending CLIENT_ADD events in your event queue. Those
563 * clients have already connected and will not be affected by this call.
564 * Only clients subsequently trying to connect will be affected.
565 * @param svr The given server.
566 * @param client_limit The maximum number of clients to handle
567 * concurrently. -1 means unlimited (default). 0
568 * effectively disables the server.
569 * @param reject_excess_clients Set to 1 to automatically disconnect
570 * excess clients as soon as they connect if you are
571 * already handling client_limit clients. Set to 0
572 * (default) to just hold off on the "accept()"
573 * system call until the number of active clients
574 * drops. This causes the kernel to queue up to 4096
575 * connections (or your kernel's limit, whichever is
576 * lower).
577 * @ingroup Ecore_Ipc_Server_Group
578 */
579void
580ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, char reject_excess_clients)
581{
582 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER))
583 {
584 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER,
585 "ecore_ipc_server_client_limit_set");
586 return;
587 }
588 ecore_con_server_client_limit_set(svr->server, client_limit, reject_excess_clients);
589}
590
557#define CLENC(_member) \ 591#define CLENC(_member) \
558 d = _ecore_ipc_dlt_int(msg._member, cl->prev.o._member, &md); \ 592 d = _ecore_ipc_dlt_int(msg._member, cl->prev.o._member, &md); \
559 if (md >= DLT_SET) \ 593 if (md >= DLT_SET) \
@@ -734,10 +768,10 @@ ecore_ipc_client_data_get(Ecore_Ipc_Client *cl)
734} 768}
735 769
736/** 770/**
737 * * Returns if SSL support is available 771 * Returns if SSL support is available
738 * * @return 1 if SSL is available, 0 if it is not. 772 * @return 1 if SSL is available, 0 if it is not.
739 * * @ingroup Ecore_Con_Client_Group 773 * @ingroup Ecore_Con_Client_Group
740 * */ 774 */
741int 775int
742ecore_ipc_ssl_available_get(void) 776ecore_ipc_ssl_available_get(void)
743{ 777{