/** * Stops ZeroMQ streamer. */ @Override public void close() throws Exception { isStarted = false; if (ctx != null) ctx.close(); if (zeroMqExSrv != null) { zeroMqExSrv.shutdown(); try { if (!zeroMqExSrv.awaitTermination(timeout, TimeUnit.MILLISECONDS)) log.warning("Timed out waiting for consumer threads to shut down, exiting uncleanly."); } catch (InterruptedException ignored) { zeroMqExSrv.shutdownNow(); log.error("Interrupted during shutdown, exiting uncleanly."); } } } }
public void destroy() { context.close(); }
@Override public void close() { context.close(selector); }
@Override public void run() { CONTEXT.close(); } });
private void closeSockets() { try { if (shellSocket != null) { shellSocket.close(); } if (controlSocket != null) { controlSocket.close(); } if (iopubSocket != null) { iopubSocket.close(); } if (stdinSocket != null) { stdinSocket.close(); } if (hearbeatSocket != null) { hearbeatSocket.close(); } context.close(); } catch (Exception e) { } }