Hang up the connection and close the object.

        Arguments:

            message -- Quit message.
977473
def disconnect(self, message=""):
        
        try:
            del self.connected
        except AttributeError:
            return

        try:
            self.socket.shutdown(socket.SHUT_WR)
            self.socket.close()
        except socket.error:
            pass
        del self.socket
        self.reactor._handle_event(
            self,
            Event("dcc_disconnect", self.peeraddress, "", [message]))
        self.reactor._remove_connection(self)
877323
def stop(self):
        """"""
        with self.lock:
            self._message_received(ConnectionClosed(self._file, self))
228950
def die(*messages):
    
    sys.stderr.write("%s.%s: " % get_caller_info(trace=True))
    sys.stderr.write(' '.join(map(str, messages)))
    sys.stderr.write('\n')
    sys.exit(1)
660828
def close(self):
        
        try:
            if self.consumer:
                self.requeue_messages(m for _, m in iter_queue(self.delay_queue))
                self.consumer.close()
        except ConnectionError:
            pass
137737
def stop(self):
        
        msg = cr.Message()
        msg.type = cr.STOP
        self.send_message(msg)
453962
def close(self):
        

        if self._is_connected:
            self.comm.close()
        self._is_connected = False
343893
public synchronized void stop() throws IOException, TimeoutException {
    if (this.stopped) {
      return;
    }

    LOGGER.info("Stopping the " + GobblinYarnAppLauncher.class.getSimpleName());

    try {
      if (this.applicationId.isPresent() && !this.applicationCompleted) {
        // Only send the shutdown message if the application has been successfully submitted and is still running
        sendShutdownRequest();
      }

      if (this.serviceManager.isPresent()) {
        this.serviceManager.get().stopAsync().awaitStopped(5, TimeUnit.MINUTES);
      }

      ExecutorsUtils.shutdownExecutorService(this.applicationStatusMonitor, Optional.of(LOGGER), 5, TimeUnit.MINUTES);

      stopYarnClient();

      disconnectHelixManager();
    } finally {
      try {
        if (this.applicationId.isPresent()) {
          cleanUpAppWorkDirectory(this.applicationId.get());
        }
      } finally {
        this.closer.close();
      }
    }

    this.stopped = true;
  }
670189
def shutdown(self, payload=None):
        
        logging.info("Work queue shutdown.")
        self.connection.close()
        self.receiving_messages = False
1243065
def quit(self):
        """"""
        try:
            RemoteWebDriver.quit(self)
        except Exception:
            # We don't care about the message because something probably has gone wrong
            pass

        if self.w3c:
            self.service.stop()
        else:
            self.binary.kill()

        if self.profile is not None:
            try:
                shutil.rmtree(self.profile.path)
                if self.profile.tempfolder is not None:
                    shutil.rmtree(self.profile.tempfolder)
            except Exception as e:
                print(str(e))
609944
def quit(self):
        
        self._send('QUIT\r\n')
        resp = self._read()
        if not resp.startswith('221'):
            logger.warning('Unexpected server response at QUIT: ' + resp)
        self._socket.close()
        self._socket = None
        self._recipients = []
        self.results = {}
259445
async def disconnect_message(self, message, context):
        

        conn_string = message.get('connection_string')
        client_id = context.user_data

        await self.disconnect(client_id, conn_string)
740683
def exit(self, status=0, message=None):
        
        if message:
            raise HelpBanner(message.strip(), code=status)
1031828
def close(self):
        """"""
        try:
            self._socket.sendall('quit\r\n')
        except socket.error:
            pass
        try:
            self._socket.close()
        except socket.error:
            pass
1283142
void close() {
        if (logger.isLoggable(Level.FINER)) {
            logger.logp(Level.FINER, logger.getName(), "close", "Close called for " + RESTClientMessagesUtil.getObjID(this) + " within connection: "
                                                                + connector.getConnectionId());
        }

        closePollingThread();

        if (notificationRegistry != null) {
            notificationRegistry.close();
        }

        if (connector.logFailovers()) {
            String disconnectMsg = RESTClientMessagesUtil.getMessage(RESTClientMessagesUtil.MEMBER_DISCONNECT, connector.getCurrentEndpoint());
            logger.logp(Level.INFO, logger.getName(), "close", disconnectMsg);
        }

        disconnect();
    }
1271054
def exit_ok(self, message, exit_code=None):
        
        logger.info("Exiting...")
        if message:
            logger.info("-----")
            logger.error("Exit message: %s", message)
            logger.info("-----")

        self.request_stop()

        if exit_code is not None:
            exit(exit_code)
564509
def disconnect(self, message=""):
        
        try:
            del self.connected
        except AttributeError:
            return

        self.quit(message)

        try:
            self.socket.shutdown(socket.SHUT_WR)
            self.socket.close()
        except socket.error:
            pass
        del self.socket
        self._handle_event(Event("disconnect", self.server, "", [message]))
228148
def close(self):
        ''''''
        # Flush any unsent message
        try:
            while self.pending():
                self.flush()
        except socket.error:
            pass
        with self._socket_lock:
            try:
                if self._socket:
                    self._socket.close()
            finally:
                self._reset()