add ecore_con_client_connected_get to avoid people scratching their heads and wonderi...
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 6 Nov 2010 00:17:04 +0000 (00:17 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 6 Nov 2010 00:17:04 +0000 (00:17 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@54204 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_con/Ecore_Con.h
src/lib/ecore_con/ecore_con.c

index d5fc0df..b311785 100644 (file)
@@ -448,6 +448,7 @@ EAPI void              ecore_con_client_flush(Ecore_Con_Client *cl);
 EAPI double            ecore_con_client_uptime_get(Ecore_Con_Client *cl);
 EAPI double            ecore_con_client_timeout_get(Ecore_Con_Client *cl);
 EAPI void              ecore_con_client_timeout_set(Ecore_Con_Client *cl, double timeout);
+EAPI Eina_Bool         ecore_con_client_connected_get(Ecore_Con_Client *cl);
 
 /**
  * @}
index 48c434e..b8e934b 100644 (file)
@@ -923,6 +923,24 @@ ecore_con_client_server_get(Ecore_Con_Client *cl)
 }
 
 /**
+ * Returns whether the client is still connected
+ * @param   cl The given client.
+ * @return  #EINA_TRUE if connected, else EINA_FALSE
+ */
+EAPI Eina_Bool
+ecore_con_client_connected_get(Ecore_Con_Client *cl)
+{
+   if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT))
+     {
+        ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT,
+                         "ecore_con_client_connected_get");
+        return EINA_FALSE;
+     }
+
+   return !cl->dead;
+}
+
+/**
  * Set the time after which the client will be disconnected when inactive
  * @param cl The client object
  * @param timeout The timeout, in seconds, to disconnect after