Returns true if all channels and the config provider are in a disconnected state.
350989
public boolean disconnected() {
    if (!configProvider.isState(LifecycleState.DISCONNECTED)) {
      return false;
    }

    for (DcpChannel channel : channels) {
      if (!channel.isState(LifecycleState.DISCONNECTED)) {
        return false;
      }
    }

    return true;
  }
494490
def _data_channel_close(self, channel, transmit=True):
        
        if channel.readyState not in ['closing', 'closed']:
            channel._setReadyState('closing')
            self._reconfig_queue.append(channel.id)
            if len(self._reconfig_queue) == 1:
                asyncio.ensure_future(self._transmit_reconfig())
102665
def on_disconnect(self):
        ""
        if self._stream is not None:
            self._stream = None
        if self._buffer is not None:
            self._buffer.close()
            self._buffer = None
        self.encoding = None
1144835
def on_disconnect(self):
        ""
        self._sock = None
        if self._buffer is not None:
            self._buffer.close()
            self._buffer = None
        self.encoder = None
1189767
final boolean isIdle() {
      for(ConnectionPoolConnection conn : connections) {
         if(conn.state.get() == ConnectionPoolConnection.STATE_OPEN) {
            return false;
         }
      }
      return true;
   }
162564
def _connected(service):
    '''
    
    '''
    state = pyconnman.ConnService(os.path.join(SERVICE_PATH, service)).get_property('State')
    return state == 'online' or state == 'ready'
27956
def is_disconnect(e, connection, cursor):
    
    if isinstance(e, OperationalError):
        # these error messages from libpq: interfaces/libpq/fe-misc.c.
        # TODO: these are sent through gettext in libpq and we can't
        # check within other locales - consider using connection.closed
        return 'terminating connection' in str(e) or \
                'closed the connection' in str(e) or \
                'connection not open' in str(e) or \
                'could not receive data from server' in str(e)
    elif isinstance(e, InterfaceError):
        # psycopg2 client errors, psycopg2/conenction.h, psycopg2/cursor.h
        return 'connection already closed' in str(e) or \
                'cursor already closed' in str(e)
    elif isinstance(e, ProgrammingError):
        # not sure where this path is originally from, it may
        # be obsolete.   It really says "losed", not "closed".
        return "closed the connection unexpectedly" in str(e)
    else:
        return False
501905
def on_disconnected(self):
        

        with self._handover_cond:

            # Wait until receiver has processed the previous notification
            while len(self._handover_dict) > 0:
                self._handover_cond.wait(self._wait_timeout)

            # Indicate to receiver that there is a termination notification
            self._handover_dict['headers'] = None  # terminate receiver
            self._handover_dict['message'] = None
            self._handover_cond.notifyAll()
919583
def blacked_out(self):
        
        if self.state is ConnectionStates.DISCONNECTED:
            if time.time() < self.last_attempt + self._reconnect_backoff:
                return True
        return False
275049
def _log_disconnect(self):
        
        if self.logged:
            self.server.stats.connectionClosed()
            self.logged = False
893907
public synchronized void checkNotExpired() {
        if (Utils.currentTimeSeconds() > getExpiryTime()) {
            stateMachine.transition(State.EXPIRED);
            disconnectFromChannel();
            throw new IllegalStateException("Channel expired");
        }
    }
870666
protected function hasSystemCallBeenInterrupted()
    {
        $lastError = $this->lastError;
        $this->lastError = null;

        // stream_select returns false when the `select` system call is interrupted by an incoming signal
        return null !== $lastError && false !== stripos($lastError, 'interrupted system call');
    }
509920
def isConnected(self):
        
        for pool in self.__pool.values():
            if not pool.empty():
                return True
        return False
105437
def disconnect(self, receiver):
        
        if receiver not in self.receivers.keys():
            raise Exception("No receiver %s was registered" % receiver)
        self.receivers[receiver].disconnect()
        del(self.receivers[receiver])
        self.__log.debug("Receiver %s disconnected" % receiver)
1209296
public static boolean ensureJedisConnection(final Jedis jedis) {
        final boolean jedisOK = testJedisConnection(jedis);
        if (!jedisOK) {
            try {
                jedis.quit();
            } catch (Exception e) {
            } // Ignore
            try {
                jedis.disconnect();
            } catch (Exception e) {
            } // Ignore
            jedis.connect();
        }
        return jedisOK;
    }
14550
public synchronized boolean setToSuspended()
    {
        if ( state.get() != State.STARTED )
        {
            return false;
        }

        if ( (currentConnectionState == ConnectionState.LOST) || (currentConnectionState == ConnectionState.SUSPENDED) )
        {
            return false;
        }

        currentConnectionState = ConnectionState.SUSPENDED;
        postState(ConnectionState.SUSPENDED);

        return true;
    }
642681
public boolean isConnected() {
    if (socket != null && socket.isConnected() && !socket.isInputShutdown() && !socket.isOutputShutdown())
      return true;
    return false;
  }