python: add SockAddr support

This commit is contained in:
Adrien Beraud committed 2017-09-18 20:36:42 +02:00
1 parent 6156d241ca
commit 8cfb71f079
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -508,9 +508,9 @@ cdef class DhtRunner(_WithID):
cpp.enableFileLogging(self.thisptr.get()[0], path.encode())
def isRunning(self):
return self.thisptr.get().isRunning()
def getBound(self, cpp.sa_family_t af = 0):
def getBound(self):
s = SockAddr()
s._addr = self.thisptr.get().getBound(af)
s._addr = self.thisptr.get().getBound()
return s
def getStorageLog(self):
return self.thisptr.get().getStorageLog().decode()
+2 -2
View File
@@ -73,7 +73,7 @@ cdef extern from "opendht/sockaddr.h" namespace "dht":
SockAddr() except +
string toString() const
in_port_t getPort() const
void setPort(in_port_t p)
void setPort(in_port_t p) const
sa_family_t getFamily() const
void setFamily(sa_family_t f)
@@ -227,7 +227,7 @@ cdef extern from "opendht/dhtrunner.h" namespace "dht":
void join()
void shutdown(ShutdownCallback)
bool isRunning()
SockAddr getBound(sa_family_t af) const
SockAddr getBound() const
string getStorageLog() const
string getRoutingTablesLog(sa_family_t af) const
string getSearchesLog(sa_family_t af) const