flush should use select with a timeout and try write every 10th of a sec
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 1 Dec 2008 10:13:16 +0000 (10:13 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 1 Dec 2008 10:13:16 +0000 (10:13 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@37877 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_con/ecore_con.c

index 5e71b16..8148182 100644 (file)
@@ -870,6 +870,17 @@ _ecore_con_server_free(Ecore_Con_Server *svr)
    t_start = ecore_time_get();
    while ((svr->write_buf) && (!svr->dead))
      {
+        fd_set rfds, wfds, exfds;
+        struct timeval tv;
+        
+        FD_ZERO(&rfds);
+        FD_ZERO(&wfds);
+        FD_SET(svr->fd, &wfds);
+        FD_ZERO(&exfds);
+        FD_SET(svr->fd, &exfds);
+        tv.tv_sec = 0;
+        tv.tv_usec = 1000000 / 10; /* 1 1/10th of a sec */
+        select(svr->fd + 1, &rfds, &wfds, &exfds, &tv);
        _ecore_con_server_flush(svr);
        t = ecore_time_get();
        if ((t - t_start) > 0.5)
@@ -905,6 +916,17 @@ _ecore_con_client_free(Ecore_Con_Client *cl)
    t_start = ecore_time_get();
    while ((cl->buf) && (!cl->dead))
      {
+        fd_set rfds, wfds, exfds;
+        struct timeval tv;
+        
+        FD_ZERO(&rfds);
+        FD_ZERO(&wfds);
+        FD_SET(cl->fd, &wfds);
+        FD_ZERO(&exfds);
+        FD_SET(cl->fd, &exfds);
+        tv.tv_sec = 0;
+        tv.tv_usec = 1000000 / 10; /* 1 1/10th of a sec */
+        select(cl->fd + 1, &rfds, &wfds, &exfds, &tv);
        _ecore_con_client_flush(cl);
        t = ecore_time_get();
        if ((t - t_start) > 0.5)