def listenUDP(self, port, protocol, interface='', maxPacketSize=8192):
        if port == 0:
            while True:
                port = randrange(1, 2 ** 16)
                if port not in self.udpPorts:
                    break
        if port in self.udpPorts:
            raise ValueError("Address in use")
        transport = MemoryDatagramTransport(
            (interface, port), protocol, maxPacketSize)
        self.udpPorts[port] = transport
        protocol.makeConnection(transport)
        return transport
Pretend to bind a UDP port and connect the given protocol to it.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/names/test/test_rootresolve.py/MemoryReactor.listenUDP