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

@inlineCallbacks
def cleanup(self):

    (yield super(UdpTrackerSession, self).cleanup())
    UdpTrackerSession.remove_transaction_id(self)
    self.ip_resolve_deferred = None
    self.result_deferred = None
    if self.scraper:
        self.clean_defer_list.append(self.scraper.stop())
        self.scraper = None
    res = (yield DeferredList(self.clean_defer_list))
    returnValue(res)
