From 7b29c50c79c6f3499fd90923c5cff35da70b39a0 Mon Sep 17 00:00:00 2001 From: Prabodh Agarwal Date: Thu, 7 Apr 2016 12:05:37 +0530 Subject: [PATCH] Provide ipv6 address support Provide ipv6 address support --- kademlia/network.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kademlia/network.py b/kademlia/network.py index 7357498..04dca70 100644 --- a/kademlia/network.py +++ b/kademlia/network.py @@ -40,15 +40,17 @@ class Server(object): self.protocol = KademliaProtocol(self.node, self.storage, ksize) self.refreshLoop = LoopingCall(self.refreshTable).start(3600) - def listen(self, port): + def listen(self, port, interface=""): """ Start listening on the given port. This is the same as calling:: reactor.listenUDP(port, server.protocol) + + Provide interface="::" to accept ipv6 address """ - return reactor.listenUDP(port, self.protocol) + return reactor.listenUDP(port, self.protocol, interface) def refreshTable(self): """