Java Code Examples for org.apache.tomcat.jni.Socket#destroy()

The following examples show how to use org.apache.tomcat.jni.Socket#destroy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AprEndpoint.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
private void destroySocket(long socket) {
    connections.remove(Long.valueOf(socket));
    if (log.isDebugEnabled()) {
        String msg = sm.getString("endpoint.debug.destroySocket",
                Long.valueOf(socket));
        if (log.isTraceEnabled()) {
            log.trace(msg, new Exception());
        } else {
            log.debug(msg);
        }
    }
    // Be VERY careful if you call this method directly. If it is called
    // twice for the same socket the JVM will core. Currently this is only
    // called from Poller.closePollset() to ensure kept alive connections
    // are closed when calling stop() followed by start().
    if (socket != 0) {
        Socket.destroy(socket);
        countDownConnection();
    }
}
 
Example 2
Source File: AprEndpoint.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
private void destroySocket(long socket) {
    connections.remove(Long.valueOf(socket));
    if (log.isDebugEnabled()) {
        String msg = sm.getString("endpoint.debug.destroySocket",
                Long.valueOf(socket));
        if (log.isTraceEnabled()) {
            log.trace(msg, new Exception());
        } else {
            log.debug(msg);
        }
    }
    // Be VERY careful if you call this method directly. If it is called
    // twice for the same socket the JVM will core. Currently this is only
    // called from Poller.closePollset() to ensure kept alive connections
    // are closed when calling stop() followed by start().
    if (socket != 0) {
        Socket.destroy(socket);
        countDownConnection();
    }
}
 
Example 3
Source File: AprEndpoint.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
private void destroySocket(long socket) {
    connections.remove(Long.valueOf(socket));
    if (log.isDebugEnabled()) {
        String msg = sm.getString("endpoint.debug.destroySocket",
                Long.valueOf(socket));
        if (log.isTraceEnabled()) {
            log.trace(msg, new Exception());
        } else {
            log.debug(msg);
        }
    }
    // Be VERY careful if you call this method directly. If it is called
    // twice for the same socket the JVM will core. Currently this is only
    // called from Poller.closePollset() to ensure kept alive connections
    // are closed when calling stop() followed by start().
    if (socket != 0) {
        Socket.destroy(socket);
        countDownConnection();
    }
}
 
Example 4
Source File: TestXxxEndpoint.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
private void destroyAprSocket(long serverSock, long pool) {
    if (serverSock != 0) {
        Socket.shutdown(serverSock, Socket.APR_SHUTDOWN_READWRITE);
        Socket.close(serverSock);
        Socket.destroy(serverSock);
    }

    if (pool != 0) {
        Pool.destroy(pool);
        pool = 0;
    }
}
 
Example 5
Source File: TestXxxEndpoint.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
private void destroyAprSocket(long serverSock, long pool) {
    if (serverSock != 0) {
        Socket.shutdown(serverSock, Socket.APR_SHUTDOWN_READWRITE);
        Socket.close(serverSock);
        Socket.destroy(serverSock);
    }

    if (pool != 0) {
        Pool.destroy(pool);
        pool = 0;
    }
}
 
Example 6
Source File: TestXxxEndpoint.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
private void destroyAprSocket(long serverSock, long pool) {
    if (serverSock != 0) {
        Socket.shutdown(serverSock, Socket.APR_SHUTDOWN_READWRITE);
        Socket.close(serverSock);
        Socket.destroy(serverSock);
    }

    if (pool != 0) {
        Pool.destroy(pool);
        pool = 0;
    }
}