'Called on disconnection. Calls disconnect handlers and cleans things up.'

def disconnected(self):

    self.connected = ''
    self.DEBUG(self.DBG, 'Disconnect    detected', 'stop')
    self.disconnect_handlers.reverse()
    for i in self.disconnect_handlers:
        i()
    self.disconnect_handlers.reverse()
    if self.__dict__.has_key('TLS'):
        self.TLS.PlugOut()
