'The L{DatagramProtocol}\'s C{startProtocol} and C{stopProtocol}
methods are called when its transports starts and stops listening,
respectively.'

def test_startStop(self):

    server = Server()
    d = server.startedDeferred = defer.Deferred()
    port1 = reactor.listenUDP(0, server, interface='127.0.0.1')
    def cbStarted(ignored):
        self.assertEqual(server.started, 1)
        self.assertEqual(server.stopped, 0)
        return port1.stopListening()
    def cbStopped(ignored):
        self.assertEqual(server.stopped, 1)
    return d.addCallback(cbStarted).addCallback(cbStopped)
