'Test L{internet.UDPServer} with a random port: starting the service
should give it valid port, and stopService should free it so that we
can start a server on the same port again.'

def test_UDP(self):

    if (not interfaces.IReactorUDP(reactor, None)):
        raise unittest.SkipTest('This    reactor    does    not    support    UDP    sockets')
    p = protocol.DatagramProtocol()
    t = internet.UDPServer(0, p)
    t.startService()
    num = t._port.getHost().port
    self.assertNotEqual(num, 0)
    def onStop(ignored):
        t = internet.UDPServer(num, p)
        t.startService()
        return t.stopService()
    return defer.maybeDeferred(t.stopService).addCallback(onStop)
