Attempts to close the client.

@param hse the session event.
494277
@Override
    public void attributeRemoved(HttpSessionBindingEvent hse) {
        Object possibleClient = hse.getValue();
        closeClient(possibleClient);
    }
903916
def close(self, code=3000, message='Go away!'):
        
        if self.state != SESSION_STATE.CLOSED:
            # Notify handler
            if self.handler is not None:
                self.handler.send_pack(proto.disconnect(code, message))

        super(Session, self).close(code, message)
1050643
@Override
    public void close() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "close");
        try {
            messageConsumer.close();
        } catch (JMSException jmse) {
            JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.entry(this, tc, "close");
        }

    }
1031980
public void close() throws IOException {
        if (sslHelper.isSocketAvailable()) {
            try {
                if (in != null)
                    in.close();
                if (out != null)
                    out.close();
            } finally {
                sslHelper.closeSocket();
            }
        }
    }
1257404
@Override
  public void close()
  {
    ServiceManagerClient client = _client;
    _client = null;
    
    if (client != null) {
      client.close();
    }
  }
784398
public void close() {
        logger.debug("enter - close()");
        try {
            connection = null;
            data = null;        
            synchronized( executions ) {
                executions.add(this);
                executions.notifyAll();
            }
        }
        finally {
            logger.debug("exit - close()");
        }
    }
620900
public void destroy() {
        DeferredBindingActions.clear();
        if(!disconnected.isEmpty()) {
            disconnected.pop();
        }
        if (getSessionFactory() == null || decNestingCount() > 0 || getParticipate()) {
            return;
        }

        // single session mode
        SessionHolder holder = (SessionHolder) TransactionSynchronizationManager.unbindResource(getSessionFactory());
        LOG.debug("Closing single Hibernate session in GrailsDispatcherServlet");
        try {
            disconnected.clear();
            SessionFactoryUtils.closeSession(holder.getSession());
        }
        catch (RuntimeException ex) {
            LOG.error("Unexpected exception on closing Hibernate Session", ex);
        }
    }
483190
public final void contextDestroyed(final ServletContextEvent sce) {
		// Stop the TciIpServer
		if (this.tcpIpServer != null) {
			this.tcpIpServer.stop();
		}

		// Stop the JmxServer
		if (this.jmxServer != null) {
			this.jmxServer.stop();
		}

		// Stop the SshServer
		if (this.sshServer != null) {
			try {
				this.sshServer.stop();
			} catch (InterruptedException e) {
				LaunchingMessageKind.ESSH0002.format(e);
			}
		}
	}
1275723
protected final void closeConnection(final JsMessagingEngine messagingEngine) {

        final String methodName = "closeConnection";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, messagingEngine);
        }

        closeConnection(messagingEngine.getUuid().toString());

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

    }
1262323
private void executeClose() {
        if (initState_ != SESSION_STATE.UNINITIALISED) {
            if (!hasNetwork_) {
                // if there's no network connectivity, purge the old install/open
                ServerRequest req = requestQueue_.peek();
                if (req != null && (req instanceof ServerRequestRegisterInstall) || (req instanceof ServerRequestRegisterOpen)) {
                    requestQueue_.dequeue();
                }
            } else {
                if (!requestQueue_.containsClose()) {
                    ServerRequest req = new ServerRequestRegisterClose(context_);
                    handleNewRequest(req);
                }
            }
            initState_ = SESSION_STATE.UNINITIALISED;
        }
    }
375665
public void close()
      throws SIResourceException, SIConnectionLostException,
             SIErrorException, SIConnectionDroppedException
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "close");

      if (!closed)
      {
         // begin D249096
         convHelper.closeSession();
         queue.purge(proxyQueueId);
         owningGroup.notifyClose(this);
         closed = true;
         // end D249096
      }
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "close");
   }
499137
public void close() {

		boolean performClose = false;
		;

		synchronized (this) {
			if (!closing && state == CHANNEL_OPEN) {
				performClose = closing = true;
			}
		}

		if (performClose) {

			synchronized (listeners) {
				for (Enumeration<ChannelEventListener> e = listeners.elements(); e
						.hasMoreElements();) {
					(e.nextElement()).channelClosing(this);
				}
			}

			try {
				// Close the ChannelOutputStream
				out.close(!isLocalEOF);

				// Send our close message
				ByteArrayWriter msg = new ByteArrayWriter(5);
				msg.write(SSH_MSG_CHANNEL_CLOSE);
				msg.writeInt(remoteid);

				try {
					if (Log.isDebugEnabled()) {
						Log.debug(this,
								"Sending SSH_MSG_CHANNEL_CLOSE id=" + channelid
										+ " rid=" + remoteid);
					}
					connection.sendMessage(msg.toByteArray(), true);
				} catch (SshException ex1) {
					if (Log.isDebugEnabled()) {
						Log.debug(this,
								"Exception attempting to send SSH_MSG_CHANNEL_CLOSE id="
										+ channelid + " rid=" + remoteid, ex1);
					}
				} finally {
					msg.close();
				}

				this.state = CHANNEL_CLOSED;

			} catch (EOFException eof) {
				// Ignore this is the message store informing of close/eof
			} catch (SshIOException ex) {
				if (Log.isDebugEnabled()) {
					Log.debug(this,
							"SSH Exception during close reason="
									+ ex.getRealException().getReason()
									+ " id=" + channelid + " rid=" + remoteid,
							ex.getRealException());
				}
				// IO Error during close so the connection has dropped
				connection.transport.disconnect(
						TransportProtocol.CONNECTION_LOST,
						"IOException during channel close: " + ex.getMessage());
			} catch (IOException ex) {
				if (Log.isDebugEnabled()) {
					Log.debug(this, "Exception during close id="
							+ channelid + " rid=" + remoteid, ex);
				}
				// IO Error during close so the connection has dropped
				connection.transport.disconnect(
						TransportProtocol.CONNECTION_LOST,
						"IOException during channel close: " + ex.getMessage());
			} finally {
				checkCloseStatus(ms.isClosed());
			}
		}
	}
1180901
void tryClose()
    {
        if (!mayBeShared)
        {
            // First: free the hounds, er, the CL leak hunter
            ClassLoaderLeakCleaner.clean(this);
            ClassLoaderLeakCleaner.cleanJdbc(Thread.currentThread());

            // Then try to call CL.close()
            Method m = null;
            try
            {
                m = this.getClass().getMethod("close");
            }
            catch (NoSuchMethodException e)
            {
                jqmlogger.trace("CL cannot be closed");
                return;
            }
            catch (SecurityException e)
            {
                jqmlogger.error("Cannot access CL.close", e);
                return;
            }

            try
            {
                m.invoke(this);
            }
            catch (Exception e)
            {
                jqmlogger.error("Cannot close CL", e);
                return;
            }
            jqmlogger.debug("CL was closed");
        }
    }
511012
def close_http_client(reason)
      @http_client.close(reason) if @http_client
      true
    rescue StandardError => e
      ErrorTracker.log(self, "Failed closing connection", e)
      false
    end
220403
public synchronized void close() throws IOException, InterruptedException {
		if (isClosed){
			return;
		}
		
		logger.info("closing client endpoint");
		if (connState == CONN_STATE_CONNECTED) {
			idPriv.disconnect();
			this.wait(1000);
		}
		if (connState >= CONN_STATE_RESOURCES_ALLOCATED) {
			idPriv.destroyQP();
		}
		idPriv.destroyId();
		group.unregisterClientEp(this);
		isClosed = true;
		logger.info("closing client done");
	}
242794
public static void close(SolrClient solrClient) {

		Assert.notNull(solrClient, "SolrClient must not be null!");

		try {
			if (solrClient instanceof Closeable) {
				solrClient.close();
			} else {
				Method shutdownMethod = ReflectionUtils.findMethod(solrClient.getClass(), "shutdown");
				if (shutdownMethod != null) {
					shutdownMethod.invoke(solrClient);
				}
			}
		} catch (Exception e) {
			throw new DataAccessResourceFailureException("Cannot close SolrClient", e);
		}
	}
190523
public void close()
    {
        LOGGER.entering(CLASS_NAME, "close");

        synchronized (lock)
        {
            if (serviceAgent != null)
            {
                serviceRegistration.unregister();

                if (LOGGER.isLoggable(Level.FINER)) LOGGER.finer("Service Agent " + this + " stopping...");

                serviceAgent.stop();

                if (LOGGER.isLoggable(Level.FINE)) LOGGER.fine("Service Agent " + this + " stopped successfully");
            }
        }

        LOGGER.exiting(CLASS_NAME, "close");
    }