more useless ecore-con functions: ecore_con_server_fd_get and ecore_con_client_fd_get
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 12 Sep 2011 08:30:22 +0000 (08:30 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 12 Sep 2011 08:30:22 +0000 (08:30 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@63344 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

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

index 24744cb..87d5b96 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * Add ecore_thread_main_loop_begin and ecore_thread_main_loop_end.
        Usefull to protect EFL call from another thread.
 
+2011-09-12  Mike Blumenkrantz
+
+        * Add ecore_con_server_fd_get, ecore_con_client_fd_get for manipulating
+          server file descriptors.
index e6653e1..645e835 100644 (file)
@@ -958,6 +958,30 @@ EAPI void              ecore_con_server_timeout_set(Ecore_Con_Server *svr, doubl
 EAPI double            ecore_con_server_timeout_get(Ecore_Con_Server *svr);
 
 /**
+ * Get the fd that the server is connected to
+ *
+ * @param svr The server object
+ * @return The fd, or -1 on failure
+ *
+ * This function returns the fd which is used by the underlying server connection.
+ * It should not be tampered with unless you REALLY know what you are doing.
+ * @note This function is only valid for servers created with ecore_con_server_connect()
+ * @since 1.1
+ */
+EAPI int               ecore_con_server_fd_get(Ecore_Con_Server *svr);
+
+/**
+ * Get the fd that the client is connected to
+ *
+ * @param cl The client object
+ * @return The fd, or -1 on failure
+ *
+ * This function returns the fd which is used by the underlying client connection.
+ * It should not be tampered with unless you REALLY know what you are doing.
+ * @since 1.1
+ */
+EAPI int               ecore_con_client_fd_get(Ecore_Con_Client *cl);
+/**
  * @}
  */
 
index 7f46c5d..0d2657e 100644 (file)
@@ -888,6 +888,29 @@ ecore_con_client_flush(Ecore_Con_Client *cl)
    _ecore_con_client_flush(cl);
 }
 
+EAPI int
+ecore_con_server_fd_get(Ecore_Con_Server *svr)
+{
+   if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER))
+     {
+        ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, __func__);
+        return -1;
+     }
+   if (svr->created) return -1;
+   return ecore_main_fd_handler_fd_get(svr->fd_handler);
+}
+
+EAPI int
+ecore_con_client_fd_get(Ecore_Con_Client *cl)
+{
+   if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT))
+     {
+        ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, __func__);
+        return -1;
+     }
+   return ecore_main_fd_handler_fd_get(cl->fd_handler);
+}
+
 /**
  * @}
  */