/** * @param msg message to send to the clients */ public synchronized void shutdown(String msg) { _isStarted = false; _log.info("Shutting down the ClientManager"); for (ClientListenerRunner listener : _listeners) listener.stopListening(); _listeners.clear(); Set<ClientConnectionRunner> runners = new HashSet<ClientConnectionRunner>(); synchronized (_runners) { for (ClientConnectionRunner runner : _runners.values()) { runners.add(runner); } } synchronized (_pendingRunners) { for (ClientConnectionRunner runner : _pendingRunners) { runners.add(runner); } } for (ClientConnectionRunner runner : runners) { runner.disconnectClient(msg, Log.WARN); } _runnersByHash.clear(); _clientTimestamper.cancel(); }
public void stop() { if (_log.shouldDebug()) _log.debug("Snark stop() begin", new Exception("I did it")); if (_umgr != null && _uhandler != null) { //_uhandler.shutdown(); _umgr.unregister(_uhandler, UpdateType.ROUTER_SIGNED, UpdateMethod.TORRENT); _umgr.unregister(_uhandler, UpdateType.ROUTER_SIGNED_SU3, UpdateMethod.TORRENT); } _running = false; _monitor.interrupt(); _connectionAcceptor.halt(); _idleChecker.cancel(); stopAllTorrents(true); if ("i2psnark".equals(_contextName)) { // only if default instance ClientAppManager cmgr = _context.clientAppManager(); if (cmgr != null) cmgr.unregister(this); } if (_log.shouldWarn()) _log.warn("Snark stop() end"); }
msg.getExpireEvent().cancel(); _context.statManager().addRateData("tunnel.fragmentedComplete", msg.getFragmentCount(), msg.getLifetime()); receiveComplete(msg);
private void cancelResend() { SimpleTimer2.TimedEvent ev = _resendEvent; if (ev != null) ev.cancel(); }
msg.getExpireEvent().cancel(); receiveComplete(msg); } else {
if (_log.shouldLog(Log.INFO)) _log.info("Re-scheduling: " + this + " timeout = " + timeoutMs + " old timeout was " + oldTimeout + " state: " + _state); cancel();
if (_log.shouldLog(Log.DEBUG)) _log.debug("Cancelling next announce " + _threadName); e.cancel(); _event = null;
/** * Caller must synch * @since 0.9.9 */ private void locked_halt() { I2PServerSocket ss = _util.getServerSocket(); if (ss != null) { try { ss.close(); } catch(I2PException ioe) { } } _badCounter.clear(); _cleaner.cancel(); }
/** * Blocking, may take a while, up to 20 seconds */ public synchronized void stop() { if (_log.shouldLog(Log.DEBUG)) _log.debug("UPnP Stop"); _shouldBeRunning = false; _rescanner.cancel(); if (_isRunning) _upnp.terminate(); _isRunning = false; _detectedAddress = null; if (_log.shouldLog(Log.DEBUG)) _log.debug("UPnP Stop Done"); }
/** * Always use the new time - ignores fuzz * @param timeoutMs */ public synchronized void forceReschedule(long timeoutMs) { // don't cancel while running! if (_state == TimedEventState.SCHEDULED) cancel(); schedule(timeoutMs); }
private void cancelResend() { SimpleTimer2.TimedEvent ev = _resendEvent; if (ev != null) ev.cancel(); }
/** * Change in return value from void to boolean in * 0.9.3 accidentally broke Syndie, sorry. * Recompile Syndie to fix it. */ public boolean cancel() { _cancelled = true; return super.cancel(); }
public void stopDecaying() { _keepDecaying = false; _decayEvent.cancel(); }