close session from remote.
512972
async def _remote_close(self, exc=None):
        """"""
        if self.state in (STATE_CLOSING, STATE_CLOSED):
            return

        log.info("close session: %s", self.id)
        self.state = STATE_CLOSING
        if exc is not None:
            self.exception = exc
            self.interrupted = True
        try:
            await self.handler(SockjsMessage(MSG_CLOSE, exc), self)
        except Exception:
            log.exception("Exception in close handler.")
986096
def close(self):
        """"""

        if self.hwman.stream.connected:
            self.hwman.disconnect()

        self.hwman.close()
        self.opened = False
19809
def _end_session(self, kill=None):
        """"""
        if self._stc:
            if kill is None:
                kill = os.environ.get('STC_SESSION_TERMINATE_ON_DISCONNECT')
                kill = _is_true(kill)
            self._stc.end_session(kill)
            self._stc = None
220813
def close(self):
        """"""
        if self.sock:
            self.sock.close()   # close it manually... there may be other refs
            self.sock = None
        if self.__response:
            self.__response.close()
            self.__response = None
        self.__state = _CS_IDLE
87428
function _close()
    {
        switch ($this->mode) {
            case self::MODE_SSH2:
                $this->ssh->_close_channel(SSH2::CHANNEL_EXEC, true);
                break;
            case self::MODE_SSH1:
                $this->ssh->disconnect();
        }
    }
1374569
def close_application(self):
        """"""
        self._debug('Closing application with session id %s' % self._current_application().session_id)
        self._cache.close()
1114362
def _stop_remote_console(self):
        
        if self._telnet_server:
            self._telnet_server.close()
            yield from self._telnet_server.wait_closed()
            self._remote_pipe.close()
            self._telnet_server = None
1257093
public void free()
    {
        if (m_record != null)
            if ((m_record.getOwner() == null) || (m_record.getOwner() == this))
                m_record.free();    // This will release the remote session (if there is one).
        m_record = null;
    }
648643
def _recv_close_ok(self, method_frame):
        '''
        
        '''
        self.channel._closed = True
        self.channel._closed_cb()
192602
def close_connection(self):
        """"""
        self._logger.info('Closing connection')
        self._closing = True
        self._connection.close()
1129855
def unlock(self):
    """"""
    if not hasattr(self, 'session'):
      raise RuntimeError('Error detected! The session that you want to close does not exist any more!')
    logger.debug("Closed database session of '%s'" % self._database)
    self.session.close()
    del self.session
1031828
def close(self):
        """"""
        try:
            self._socket.sendall('quit\r\n')
        except socket.error:
            pass
        try:
            self._socket.close()
        except socket.error:
            pass
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))
762606
def close(self):
        """"""
        if self._connection:
            self._connection.close()
        self._response.close()
51717
def close(self):
        '''  '''
        cache_key = self._cache_key()
        SSH_CONNECTION_CACHE.pop(cache_key, None)
        SFTP_CONNECTION_CACHE.pop(cache_key, None)
        if self.sftp is not None:
            self.sftp.close()
        self.ssh.close()
1010101
protected void safeClose () {
        Session closeSession = this.socketSession;
        this.socketSession = null;

        try {
            if (closeSession != null) {
                //
                // Remove from the registry first in case the close blocks for a while.  Doing so prevents additional
                // errors logged for attempts to send to this now-defunct websocket.
                //
                registry.remove(this.socketSessionId);
                closeSession.close();
            }
        } catch (IOException ioExc) {
            log.debug("io exception on safe close of session", ioExc);
        }
    }
1170264
def close(self):
        """"""

        if self.closed or self.connection.closed:
            return

        self._cursor.close()
        self.closed = True