'Add check to ensure that a session is established within
a reasonable amount of time.'

def _session_timeout_check(self, event=None):

    def _handle_session_timeout():
        if (not self.session_started_event.is_set()):
            log.debug((u'Session    start    has    taken    more    ' + u'than    %d    seconds'), self.session_timeout)
            self.disconnect(reconnect=self.auto_reconnect)
    self.schedule(u'Session    timeout    check', self.session_timeout, _handle_session_timeout)
