public static int[] getBWLimits(String host, int port) { int[] rv = null; try { I2PClient client = new I2PSimpleClient(); Properties opts = new Properties(); opts.put(I2PClient.PROP_TCP_HOST, host); opts.put(I2PClient.PROP_TCP_PORT, "" + port); I2PSession session = client.createSession(null, opts); session.connect(); rv = session.bandwidthLimits(); session.destroySession(); } catch (I2PSessionException ise) {} return rv; }
/** * I2PTunnelTask Methods * * Classes should override to close UDP side as well */ public boolean close(boolean forced) { if (!open) return true; if (_session != null) { try { _session.destroySession(); } catch (I2PSessionException ise) {} } l.log("Closing client " + toString()); open = false; return true; }
if (_session != null) { try { _session.destroySession(); } catch (I2PSessionException ise) {
/** * @since 0.9.21 */ public void removeSubsession(I2PSession session) { if (!(session instanceof SubSession)) return; synchronized(_subsessionLock) { _subsessions.remove(session); SessionId id = ((SubSession) session).getSessionId(); if (id != null) _subsessionMap.remove(id); /// tell the subsession try { // doesn't really throw session.destroySession(); } catch (I2PSessionException ise) {} } // do we need this here? subsession.destroySession() calls primary Destination d = session.getMyDestination(); if (d != null) _context.keyRing().remove(d.calculateHash()); }
/** * I2PTunnelTask Methods * * Classes should override to close UDP side as well */ public boolean close(boolean forced) { if (!open) return true; synchronized (lock) { l.log("Shutting down server " + toString()); try { if (_session != null) { _session.destroySession(); } } catch (I2PException ex) { _log.error("Error destroying the session", ex); } l.log("Server shut down."); open = false; return true; } }
session.destroySession(); if (_log.shouldLog(Log.INFO)) _log.info("Session destroyed: " + session);
} finally { if (session != null) session.destroySession();
} finally { if (session != null) { try { session.destroySession(); } catch (I2PSessionException ise) {}
_session.destroySession(); } catch (I2PSessionException ise) { _log.warn("Unable to destroy the session", ise);
if (_ownDest) { try { session.destroySession(); } catch (I2PException ex) {}
public void run() { if (_log.shouldLog(Log.DEBUG)) _log.debug("SAM message-based session handler running"); synchronized (runningLock) { while (stillRunning) { try { runningLock.wait(); } catch (InterruptedException ie) {} } } if (_log.shouldLog(Log.DEBUG)) _log.debug("Shutting down SAM message-based session handler"); shutDown(); session.removeListener(listenProtocol, listenPort); if (_isOwnSession) { try { if (_log.shouldLog(Log.DEBUG)) _log.debug("Destroying I2P session..."); session.destroySession(); if (_log.shouldLog(Log.DEBUG)) _log.debug("I2P session destroyed"); } catch (I2PSessionException e) { _log.error("Error destroying I2P session", e); } } }
session.destroySession(); } catch (I2PException ex) { _log.error("Error destroying the session", ex);
@Override public void run() { try { i2pSession.destroySession(); System.out.println("Finished"); } catch (I2PSessionException e) { e.printStackTrace(); } } });
public void shutDown() { stopAllServices(); try { if (i2pSession != null) i2pSession.destroySession(); } catch (I2PSessionException e) { log.error("Can't destroy I2P session.", e); } if (socketManager != null) socketManager.destroySocketManager(); connectTask = null; networkStatusChanged(); }
_session.destroySession(); } catch (I2PSessionException ise) { _log.warn("Unable to destroy the session", ise);