Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_ipc


Modified Files:
        Ecore_Ipc.h ecore_ipc.c 


Log Message:


mirror changes in ipc as with con

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_ipc/Ecore_Ipc.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- Ecore_Ipc.h 22 Apr 2005 03:03:55 -0000      1.8
+++ Ecore_Ipc.h 29 Apr 2005 04:58:55 -0000      1.9
@@ -288,7 +288,8 @@
    EAPI int               ecore_ipc_server_connected_get(Ecore_Ipc_Server 
*svr);
    /* FIXME: this needs to become an ipc message */
    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);
-
+   EAPI void              ecore_ipc_server_client_limit_set(Ecore_Ipc_Server 
*svr, int client_limit, char reject_excess_clients);
+   
    /* FIXME: this needs to become an ipc message */
    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);
    EAPI Ecore_Ipc_Server *ecore_ipc_client_server_get(Ecore_Ipc_Client *cl);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_ipc/ecore_ipc.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ecore_ipc.c 9 Apr 2005 00:07:32 -0000       1.18
+++ ecore_ipc.c 29 Apr 2005 04:58:55 -0000      1.19
@@ -554,6 +554,40 @@
    return ret;
 }
 
+/**
+ * Sets a limit on the number of clients that can be handled concurrently
+ * by the given server, and a policy on what to do if excess clients try to
+ * connect.
+ * Beware that if you set this once ecore is already running, you may
+ * already have pending CLIENT_ADD events in your event queue.  Those
+ * clients have already connected and will not be affected by this call.
+ * Only clients subsequently trying to connect will be affected.
+ * @param   svr           The given server.
+ * @param   client_limit  The maximum number of clients to handle
+ *                        concurrently.  -1 means unlimited (default).  0
+ *                        effectively disables the server.
+ * @param   reject_excess_clients  Set to 1 to automatically disconnect
+ *                        excess clients as soon as they connect if you are
+ *                        already handling client_limit clients.  Set to 0
+ *                        (default) to just hold off on the "accept()"
+ *                        system call until the number of active clients
+ *                        drops. This causes the kernel to queue up to 4096
+ *                        connections (or your kernel's limit, whichever is
+ *                        lower).
+ * @ingroup Ecore_Ipc_Server_Group
+ */
+void
+ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, 
char reject_excess_clients)
+{
+   if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER))
+     {
+       ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER,
+                        "ecore_ipc_server_client_limit_set");
+       return;
+     }
+   ecore_con_server_client_limit_set(svr->server, client_limit, 
reject_excess_clients);
+}
+
 #define CLENC(_member) \
    d = _ecore_ipc_dlt_int(msg._member, cl->prev.o._member, &md); \
    if (md >= DLT_SET) \
@@ -734,10 +768,10 @@
 }
 
 /**
- *  * Returns if SSL support is available
- *  * @return  1 if SSL is available, 0 if it is not.
- *  * @ingroup Ecore_Con_Client_Group
- *  */
+ * Returns if SSL support is available
+ * @return  1 if SSL is available, 0 if it is not.
+ * @ingroup Ecore_Con_Client_Group
+ */
 int
 ecore_ipc_ssl_available_get(void)
 {




-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to