Called when a monitor has disconnected
195063
function(error) {
        if (disconnectError) {return;}
        if (error) {
          var err = {code:'DISONNECT_ERROR', err: error};
          disconnectError = true;
          logger.error('onDisconnect', err);
          return callback(err);
        }
        for (var name1 in t.monitors) {
          if (t.monitors[name1].isConnected()) {
            return;
          }
        }
        t.set({started:false});
        t.compiledScript = null;
        callback();
      }
741835
function connectError(error)
	{
		if (error == evothings.easyble.error.DISCONNECTED)
		{
			showMessage('Device disconnected')
		}
		else
		{
			showMessage('Connect error: ' + error)
		}
	}
1078564
@Override
    public void setMonitorEnabled(boolean enabled) {
        if(enabled) {
            // create and start background monitor
            if (monitor == null) {
                monitor = new AdcGpioProviderBase.ADCMonitor();
                monitor.start();
            }
        }
        else{
            try {
                // if a monitor is running, then shut it down now
                if (monitor != null) {
                    // shutdown monitoring thread
                    monitor.shutdown();
                    monitor = null;
                }
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
276891
def disconnect(self):
        """"""

        if not self.connected:
            raise HardwareError("Cannot disconnect when we are not connected")

        # Close the streaming and tracing interfaces when we disconnect
        self._reports = None
        self._traces = None

        self._loop.run_coroutine(self.adapter.disconnect(0))
        self.connected = False
        self.connection_interrupted = False
        self.connection_string = None
956610
def disconnect(self):
        """"""
        if self._connected:
            self._connected = False
            self._conn.disconnect()
308080
def monitor_exit(self):
        
        return pyhsm.debug_cmd.YHSM_Cmd_Monitor_Exit(self.stick).execute(read_response=False)
1266740
def _handle_disconnect(self, sid, namespace):
        """"""
        namespace = namespace or '/'
        if namespace == '/':
            namespace_list = list(self.manager.get_namespaces())
        else:
            namespace_list = [namespace]
        for n in namespace_list:
            if n != '/' and self.manager.is_connected(sid, n):
                self._trigger_event('disconnect', n, sid)
                self.manager.disconnect(sid, n)
        if namespace == '/' and self.manager.is_connected(sid, namespace):
            self._trigger_event('disconnect', '/', sid)
            self.manager.disconnect(sid, '/')
744396
private void sawMonitorExit(int pc) {
        if (!monitorSyncPCs.isEmpty()) {
            ScopeBlock sb = findSynchronizedScopeBlock(rootScopeBlock, monitorSyncPCs.get(0).intValue());
            if (sb != null) {
                sb.setFinish(pc);
            }
            monitorSyncPCs.remove(monitorSyncPCs.size() - 1);
        }
    }
254031
def _monitor(last_ping, stop_plugin, is_shutting_down, timeout=5):
    
    _timeout_count = 0
    _last_check = time.time()
    _sleep_interval = 1
    # set _sleep_interval if less than the timeout
    if timeout < _sleep_interval:
        _sleep_interval = timeout
    while True:
        time.sleep(_sleep_interval)
        # Signals that stop_plugin has been called
        if is_shutting_down():
            return
        # have we missed a ping during the last timeout duration
        if ((time.time() - _last_check) > timeout) and ((time.time() - last_ping()) > timeout):
            # reset last_check
            _last_check = time.time()
            _timeout_count += 1
            LOG.warning("Missed ping health check from the framework. " +
                        "({} of 3)".format(_timeout_count))
            if _timeout_count >= 3:
                stop_plugin()
                return
        elif (time.time() - last_ping()) <= timeout:
            _timeout_count = 0
967772
def do_disconnect(self, arg):
        '''  '''
        if not self.arm.is_connected():
            print(self.style.error('Error: ', 'Arm is already disconnected.'))
        else:
            self.arm.disconnect()
            print(self.style.success('Success: ', 'Disconnected.'))
252442
def close_stream(self):
        """"""
        if not self.is_connected:
            return

        self.stream.close()
        self.state = DISCONNECTED
        self.on_close.send(self)
202935
def disconnect_controller(self, vid, pid, serial):
        """"""
        self.lib.tdDisconnectTellStickController(vid, pid, serial)
565560
def remove(self, cb):
        """"""
        if cb in self.callbacks:
            self.callbacks.remove(cb)
            new_monitor = 0
            for c in self.callbacks:
                new_monitor |= c.bit
            if new_monitor != self.monitor:
                self.monitor = new_monitor
                yield from self.pi._pigpio_aio_command(
                    _PI_CMD_NB, self.handle, self.monitor)
802564
function closeConn(userId) {
            if(recorder && recorderTimeoutID) {
                recorder.stop();
            }

            app.helpers.notifyIfUserLeaveCall(app.currentSession, userId, 'disconnected', 'Disconnected');
            app.currentSession.closeConnection(userId);
        }
1274345
def disconnect(self, device):
        """"""
        # self.device.ctrl.sendcontrol(']')
        # self.device.ctrl.sendline('quit')
        self.log("TELNET disconnect")
        try:
            self.device.ctrl.send(chr(4))
        except OSError:
            self.log("Protocol already disconnected")
789038
def _add_monitor(monitors, handle, callback, devices, events):
    """"""

    for conn_string in devices:
        data = monitors.get(conn_string)
        if data is None:
            data = dict()
            monitors[conn_string] = data

        for event in events:
            event_dict = data.get(event)
            if event_dict is None:
                event_dict = dict()
                data[event] = event_dict

            event_dict[handle] = callback
644007
def disconnect(self):
        """"""

        if not self.connected:
            return
        self.connected = False

        self.connection.disconnect()

        if self._heartbeat_loop:
            self._heartbeat_loop.kill()
        self._recv_loop.kill()

        self._reset_attributes()

        self.emit(self.EVENT_DISCONNECTED)