Use a very loose condition to determine if the address is an IPv6 address or 
not.

Signed-off-by: Can Zhang <[email protected]>
---
 ryu/lib/hub.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ryu/lib/hub.py b/ryu/lib/hub.py
index 44e5fea..e74b74a 100644
--- a/ryu/lib/hub.py
+++ b/ryu/lib/hub.py
@@ -33,6 +33,7 @@ if HUB_TYPE == 'eventlet':
     import eventlet.queue
     import eventlet.timeout
     import eventlet.wsgi
+    from eventlet.green import socket
     import ssl
     import traceback
 
@@ -67,7 +68,12 @@ if HUB_TYPE == 'eventlet':
                      spawn='default', **ssl_args):
             assert backlog is None
             assert spawn == 'default'
-            self.server = eventlet.listen(listen_info)
+
+            if ':' in listen_info[0]:
+                self.server = eventlet.listen(listen_info,
+                                              family=socket.AF_INET6)
+            else:
+                self.server = eventlet.listen(listen_info)
             if ssl_args:
                 def wrap_and_handle(sock, addr):
                     ssl_args.setdefault('server_side', True)
-- 
1.7.11.1



------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to