Skip to content

Commit

Permalink
Fixed usage of system-level poll(). This bug was unveiled after fixin…
Browse files Browse the repository at this point in the history
…g bug tomerfiliba-org#182

and observing spinning processes.
  • Loading branch information
glpatcern committed Mar 31, 2016
1 parent 843ba58 commit 4bc5c55
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rpyc/lib/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def register(self, fd, mode):
if "e" in mode:
flags |= select_module.POLLERR
if "h" in mode:
# POLLRDHUP is a linux only extension, not know to python, but nevertheless
# POLLRDHUP is a linux only extension, not known to python, but nevertheless
# used and thus needed in the flags
POLLRDHUP = 0x2000
flags |= select_module.POLLHUP | select_module.POLLNVAL | POLLRDHUP
Expand All @@ -101,6 +101,9 @@ def register(self, fd, mode):
def unregister(self, fd):
self._poll.unregister(fd)
def poll(self, timeout = None):
if timeout:
# the real poll takes milliseconds while we have seconds here
timeout = 1000*timeout
events = self._poll.poll(timeout)
processed = []
for fd, evt in events:
Expand Down

0 comments on commit 4bc5c55

Please sign in to comment.