'Cleans the session by cancelling all deferreds and closing sockets.
:return: A deferred that fires once the cleanup is done.'

def cleanup(self):

    self._infohash_list = None
    self._session = None
    return defer.succeed(None)
