Notifies the IOAdapter that the session has closed.
322168
@Override
	public void sessionClosed(IoSession session) throws Exception {
		log.debug("Session closed for sensor {}.", session);
		if (this.sensorIoAdapter != null) {
			this.sensorIoAdapter.sensorDisconnected(session);
		}
	}
1102593
public void sendClose() throws IOException {
        closeReason = "";
        closeCode = CloseMessage.NORMAL_CLOSURE;
        StreamSinkFrameChannel closeChannel = send(WebSocketFrameType.CLOSE);
        closeChannel.shutdownWrites();
        if (!closeChannel.flush()) {
            closeChannel.getWriteSetter().set(ChannelListeners.flushingChannelListener(
                    null, new ChannelExceptionHandler<StreamSinkChannel>() {
                @Override
                public void handleException(final StreamSinkChannel channel, final IOException exception) {
                    IoUtils.safeClose(WebSocketChannel.this);
                }
            }
            ));
            closeChannel.resumeWrites();
        }
    }
1323323
void closeSocket(boolean tryReconnectIfConnected) throws InterruptedException {
        boolean wasConnected = false;

        statusLock.lock();
        try {
            if (isDisconnectingOrClosed()) {
                waitForDisconnectOrClose(this.options.getConnectionTimeout());
                return;
            } else {
                this.disconnecting = true;
                this.exceptionDuringConnectChange = null;
                wasConnected = (this.status == Status.CONNECTED);
                statusChanged.signalAll();
            }
        } finally {
            statusLock.unlock();
        }

        closeSocketImpl();

        statusLock.lock();
        try {
            updateStatus(Status.DISCONNECTED);
            this.exceptionDuringConnectChange = null; // Ignore IOExceptions during closeSocketImpl()
            this.disconnecting = false;
            statusChanged.signalAll();
        } finally {
            statusLock.unlock();
        }

        if (isClosing()) { // Bit of a misname, but closing means we are in the close method or were asked
                           // to be
            close();
        } else if (wasConnected && tryReconnectIfConnected) {
            reconnect();
        }
    }
854052
async def ensure_closed(self):
        """"""
        if self._writer is None:
            # connection has been closed
            return
        send_data = struct.pack('<i', 1) + int2byte(COMMAND.COM_QUIT)
        self._writer.write(send_data)
        await self._writer.drain()
        self.close()
1052511
void checkNotClosed() throws SISessionUnavailableException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "checkNotClosed");

        try
        {
            synchronized (_localConsumerPoint)
            {
                _localConsumerPoint.checkNotClosed();
            }
        } catch (SISessionUnavailableException e)
        {
            // No FFDC code needed
            SibTr.exception(tc, e);

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "checkNotClosed", e);

            throw e;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "checkNotClosed");
    }
603601
def closed(self, error=None):
        

        if self._application:
            try:
                self._application.closed(error)
            except Exception:
                # Ignore exceptions from the notification
                pass
4002
private boolean connectionLost(JMXConnectionNotification connectionNotification) {
        return connectionNotification.getType().equals(JMXConnectionNotification.NOTIFS_LOST)
                || connectionNotification.getType().equals(JMXConnectionNotification.CLOSED)
                || connectionNotification.getType().equals(JMXConnectionNotification.FAILED);
    }
1028613
private void checkCloseConnection(ChannelFuture future) {
        // If this connection is closing and the graceful shutdown has completed, close the connection
        // once this operation completes.
        if (closeListener != null && isGracefulShutdownComplete()) {
            ChannelFutureListener closeListener = this.closeListener;
            // This method could be called multiple times
            // and we don't want to notify the closeListener multiple times.
            this.closeListener = null;
            try {
                closeListener.operationComplete(future);
            } catch (Exception e) {
                throw new IllegalStateException("Close listener threw an unexpected exception", e);
            }
        }
    }
77249
void checkNotClosed() throws SISessionUnavailableException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "checkNotClosed");

    synchronized (this)
    {
      if (_closed)
      {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          SibTr.exit(tc, "checkNotClosed", "Object closed");

        throw new SISessionUnavailableException(
          nls.getFormattedMessage("OBJECT_CLOSED_ERROR_CWSIP0081", 
                                  new Object[] { _dest.getName(),
                                                 _dest.getMessageProcessor().getMessagingEngineName() }, 
                                  null));
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "checkNotClosed");
  }
1233781
public synchronized void close() throws IOException {
        if(getStatus().equals(ConnectionStatus.CLOSED)){
            return ;
        }
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Closing client for session: 0x"
                      + getSessionId());
        }
        connectRun.set(false);

        try{
            clientSocket.cleanup();
        }catch(Exception e){
            LOGGER.warn("Close the WSDirectorySocket get error.", e);
        }

        try {
            setStatus(ConnectionStatus.CLOSED);
            sendCloseSession();
            closeSession();
            eventThread.queueEventOfDeath();
        } catch (ServiceException e) {
            LOGGER.warn("Execute the CloseSession Protocol failed when close", e);
        }
    }
613918
@Override
	public void close() throws IOException {
		try {
			if (session != null) {
				session.close();
			}
		} catch (Exception e) {
			LOG.error("Error while closing session.", e);
		}

		try {
			if (cluster != null) {
				cluster.close();
			}
		} catch (Exception e) {
			LOG.error("Error while closing cluster.", e);
		}
	}
889119
def is_closed(self):
        
        return (self.state == SESSION_STATE.CLOSED 
                or self.state == SESSION_STATE.CLOSING)
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.")
195340
public void close() throws IOException {
        if (!_closed) {
            try {
                flush();
            } catch (Throwable t) {
                LOG.debug(t.getMessage(), t);
            }
            _closed = true;
            super.close();
        }
    }
721568
private void sendCloseSession() throws IOException{
        ProtocolHeader h = new ProtocolHeader();
        h.setType(ProtocolType.CloseSession);

        sendAdminPacket(h, null);
    }
352962
public void close() throws SIConnectionLostException, SIResourceException,
            SIErrorException, SIConnectionDroppedException {

        final String methodName = "close";
        if (TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName);
        }

        _delegateSession.close();

        if (TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
1145934
@Override
    public void close() throws IOException {
        try {
            if (reference != null) {
                closer.close(reference);
            }
        } catch (Exception e) {
            throw new IOException(e);
        } finally {
            this.wasClosed = true;
        }
    }