def name(self): """Return the server socket’s address (host, port).""" return ip.addrToString(self.localAddress()), self.localPort()
def peerName(self): return ip.addrToString(self.peerAddress()), self.peerPort()
def receiveFrom(self): size = self.pendingDatagramSize() if size>0: data, addr, port = self.readDatagram(size) return data, (ip.addrToString(addr), port) else: return bytes(), None