Commit 55ae9f31 authored by Vincent Pelletier's avatar Vincent Pelletier

Add the possibility in epoll to disable timeout in a python's select compatible way.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@275 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent d16b01f2
...@@ -75,8 +75,11 @@ class Epoll(object): ...@@ -75,8 +75,11 @@ class Epoll(object):
self.events = epoll_event_array() self.events = epoll_event_array()
def poll(self, timeout = 1): def poll(self, timeout = 1):
timeout *= 1000 if timeout is None:
timeout = int(timeout) timeout = -1
else:
timeout *= 1000
timeout = int(timeout)
while 1: while 1:
n = epoll_wait(self.efd, byref(self.events), self.maxevents, n = epoll_wait(self.efd, byref(self.events), self.maxevents,
timeout) timeout)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment