python*: Use poll instead of select in ckflush.
authorFredrik Tolf <fredrik@dolda2000.com>
Sat, 2 Feb 2019 10:44:41 +0000 (11:44 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Sat, 2 Feb 2019 10:44:41 +0000 (11:44 +0100)
python/ashd/serve.py
python3/ashd/serve.py

index e9f92b0..3de5861 100644 (file)
@@ -75,8 +75,10 @@ class handler(object):
     def handle(self, request):
         raise Exception()
     def ckflush(self, req):
+        p = select.poll()
+        p.register(req, select.POLLOUT)
         while len(req.buffer) > 0:
-            rls, wls, els = select.select([], [req], [req])
+            p.poll()
             req.flush()
     def close(self):
         pass
index 87f60a0..0927710 100644 (file)
@@ -75,8 +75,10 @@ class handler(object):
     def handle(self, request):
         raise Exception()
     def ckflush(self, req):
+        p = select.poll()
+        p.register(req, select.POLLOUT)
         while len(req.buffer) > 0:
-            rls, wls, els = select.select([], [req], [req])
+            p.poll()
             req.flush()
     def close(self):
         pass