'Initialize or reset all of our internal state variables for a given
connection. If we disconnect and reconnect, all of our state needs to
be wiped.'

def _init_connection_state(self):

    active_timers = list(self._active_timers.keys())
    for timer in active_timers:
        self.remove_timeout(timer)
    if global_sigint_watcher:
        global_sigint_watcher.stop()
    if global_sigterm_watcher:
        global_sigterm_watcher.stop()
    if self._io_watcher:
        self._io_watcher.stop()
    super(LibevConnection, self)._init_connection_state()
