'Stop listening on the port if it is already listening, otherwise,
cancel the attempt to listen.
@return: a L{Deferred<twisted.internet.defer.Deferred>} which fires
with L{None} when the port has stopped listening.'

def stopService(self):

    self._waitingForPort.cancel()
    def stopIt(port):
        if (port is not None):
            return port.stopListening()
    d = self._waitingForPort.addCallback(stopIt)
    def stop(passthrough):
        self.running = False
        return passthrough
    d.addBoth(stop)
    return d
