The function poll from poller should return a list of tuples
containing the events and their types.

On Windows the event type is not returned at the moment.
Instead of returning zero all the time, we check to see
the type of event and we set it accordingly before returning
the list.

This is used only for debugging purposes inside the function
"__log_wakeup" later on.

Signed-off-by: Alin Balutoiu <[email protected]>
---
 python/ovs/poller.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/python/ovs/poller.py b/python/ovs/poller.py
index 809e512..2f3fcf9 100644
--- a/python/ovs/poller.py
+++ b/python/ovs/poller.py
@@ -112,7 +112,14 @@ class _SelectSelect(object):
             if retval == winutils.winerror.WAIT_TIMEOUT:
                 return []
 
-            return [(events[retval], 0)]
+            if events[retval] in self.rlist:
+                revent = POLLIN
+            elif events[retval] in self.wlist:
+                revent = POLLOUT
+            else:
+                revent = POLLERR
+
+            return [(events[retval], revent)]
         else:
             if timeout == -1:
                 # epoll uses -1 for infinite timeout, select uses None.
-- 
2.10.0.windows.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to