from twisted.internet import protocol, reactor, task
class peer(protocol.DatagramProtocol):
def sendJoin(self):
self.transport.write('Join',("127.0.0.1", 8001))
def startProtocol(self):
self.sendJoin()
reactor.listenUDP(8002, peer())#if this is busy, listen on next available port
reactor.run()
如果其他对等点已经在监听该端口,我如何监听另一个端口,例如 8003?