Disconnects websocket connection.
180531
public void disconnect(){
        if(timer != null){
            timer.cancel();
        }
        if (ws != null && ws.isOpen()) {
            ws.disconnect();
            subscribedTokens = new HashSet<>();
            modeMap.clear();
        }
    }
217120
private function disconnect()
    {
        if (is_resource($this->_conn)) {
            fclose($this->_conn);
        }
        $this->_auto_reconnect = false;
        $this->_conn = null;
    }
169514
@Skip
    @Override
    public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise)
            throws Exception {
        ctx.disconnect(promise);
    }
1144835
def on_disconnect(self):
        ""
        self._sock = None
        if self._buffer is not None:
            self._buffer.close()
            self._buffer = None
        self.encoder = None
901691
def closed(self, code, reason=None):
        """"""
        if code != 1000:
            self._error = errors.SignalFlowException(code, reason)
            _logger.info('Lost WebSocket connection with %s (%s: %s).',
                         self, code, reason)
            for c in self._channels.values():
                c.offer(WebSocketComputationChannel.END_SENTINEL)
        self._channels.clear()
        with self._connection_cv:
            self._connected = False
            self._connection_cv.notify()
297172
def ws_disconnect(message):
    
    language = message.channel_session['knocker']
    gr = Group('knocker-{0}'.format(language))
    gr.discard(message.reply_channel)
967746
def disconnect(self):
        """"""
        # here we just request the disconnection
        # later in _handle_eio_disconnect we invoke the disconnect handler
        for n in self.namespaces:
            self._send_packet(packet.Packet(packet.DISCONNECT, namespace=n))
        self._send_packet(packet.Packet(
            packet.DISCONNECT, namespace='/'))
        self.eio.disconnect(abort=True)
400521
def disconnect(self):
        ""
        self._checkpid()
        all_conns = chain(self._available_connections,
                          self._in_use_connections)
        for connection in all_conns:
            connection.disconnect()
1178148
public void disconnectSocket() {
        synchronized (lock) {
            if (socketConnection != null) {
                socketConnection.setManageReconnection(false);
                socketConnection.disconnect();
            }
            lock.notifyAll();
        }
    }
1208575
def disconnect(self):
        """"""
        self.chain.connection.log("Disconnecting: {}".format(self))
        if self.connected:
            if self.protocol:
                if self.is_console:
                    while self.mode != 'global':
                        try:
                            self.send('exit', timeout=10)
                        except CommandTimeoutError:
                            break

                self.protocol.disconnect(self.driver)
                self.protocol = None

            self.connected = False
            self.ctrl = None
1045531
async def disconnect(self, *, force=False):
        
        if not force and not self.is_connected():
            return

        self.stop()
        self._connected.clear()

        try:
            if self.ws:
                await self.ws.close()

            await self.terminate_handshake(remove=True)
        finally:
            if self.socket:
                self.socket.close()
616118
def disconnect(self):
        """"""
        try:
            self.cleanup()
            if self.protocol == "ssh":
                self.paramiko_cleanup()
            elif self.protocol == "telnet":
                self.remote_conn.close()
            elif self.protocol == "serial":
                self.remote_conn.close()
        except Exception:
            # There have been race conditions observed on disconnect.
            pass
        finally:
            self.remote_conn_pre = None
            self.remote_conn = None
            self.close_session_log()
551312
async def disconnect(self):
        """"""
        self._data = await self._handler.disconnect(
            system_id=self.node.system_id, id=self.id)
308612
public void disconnect() {
		if(!isConnected){
			if(this.isReconnecting){
				stopReconnecting();
				this.isConnecting = false;
			} else {
				raiseOrtcEvent(EventEnum.OnException,this, new OrtcNotConnectedException());
			}
		}else{
			stopHeartBeatInterval();
			this.disconnectIntern();
		}
	}
575324
def disconnect(self, slot):
        """"""
        if self.is_connected(slot):
            self.slots.remove(slot)
1023500
function (obj) {
			if (typeof connHandler === 'function')
				connHandler('disconnect');
			
			SR.Warn('disconnected... obj: ');
			SR.Warn(obj);
			
			// attempt to re-connect
			if (typeof conn_options === 'object') {
				removeEntry(currentEntry);
				currentEntry = undefined;
				SR.Warn('re-connecting websocket with options');
				SR.Warn(conn_options);
				SR.setSocketServer(conn_options);
			}
		}
261031
def disconnect(self):
        
        try: # connection may already be disconnected, so catch exceptions
            self.socket.shutdown(socket.SHUT_RDWR) # a proper disconnect
        except socket.error:
            pass
        self.socket.close()
        self.connected = False