void destroyPull() { if (shutdowned) return; // Causes segfault in AprSocketSource.poll() method, so this function must be called from it try { Socket.close(socket); // or // Socket.shutdown(socket, Socket.APR_SHUTDOWN_READWRITE); Pool.destroy(pool); } catch (Exception e) { s_logger.info("[ignored]" + "failure during network cleanup: " + e.getLocalizedMessage()); } }