'Stops the UDP scraper and closes the socket.
:return: A deferred that fires once it has closed the connection.'

def stop(self):

    self._logger.info('Shutting    down    scraper    which    was    connected    to    ip    %s,    port    %s', self.ip_address, self.port)
    if self.timeout_call.active():
        self.timeout_call.cancel()
    if (self.transport and self.numPorts and self.transport.connected):
        return maybeDeferred(self.transport.stopListening)
    return defer.succeed(True)
