This patch adds "socket" field to RemoteOvsdb
to get sockets which connects to switches.

e.g.)
    @set_ev_cls(ovsdb_event.EventNewOVSDBConnection)
    def handle_new_ovsdb_connection(self, ev):
        print(ev.client.socket.getsockname()[0])

Signed-off-by: Satoshi Fujimoto <satoshi.fujimo...@gmail.com>
---
 ryu/services/protocols/ovsdb/client.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ryu/services/protocols/ovsdb/client.py 
b/ryu/services/protocols/ovsdb/client.py
index 7e7d271..7c939f0 100644
--- a/ryu/services/protocols/ovsdb/client.py
+++ b/ryu/services/protocols/ovsdb/client.py
@@ -333,6 +333,7 @@ class RemoteOvsdb(app_manager.RyuApp):
         fsm.set_name(name)
 
         kwargs = kwargs.copy()
+        kwargs['socket'] = sock
         kwargs['address'] = address
         kwargs['idl'] = idl
         kwargs['name'] = name
@@ -359,6 +360,7 @@ class RemoteOvsdb(app_manager.RyuApp):
 
     def __init__(self, *args, **kwargs):
         super(RemoteOvsdb, self).__init__(*args, **kwargs)
+        self.socket = kwargs['socket']
         self.address = kwargs['address']
         self._idl = kwargs['idl']
         self.system_id = kwargs['system_id']
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to