From 766c12242e413ea80fb78fa9f0e65ace51fd27c9 Mon Sep 17 00:00:00 2001 From: jrandom <jrandom> Date: Fri, 7 May 2004 01:45:12 +0000 Subject: [PATCH] logging, javadoc --- .../client/streaming/I2PServerSocketImpl.java | 3 ++- .../client/streaming/I2PSocketManager.java | 19 ++++++++++++------- .../client/streaming/I2PSocketOptions.java | 1 - 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocketImpl.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocketImpl.java index ae72933739..c42ea1eb16 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocketImpl.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocketImpl.java @@ -38,7 +38,8 @@ class I2PServerSocketImpl implements I2PServerSocket { /** * Waits for the next socket connecting. If a remote user tried to make a * connection and the local application wasn't .accept()ing new connections, - * they should get refused (if .accept() doesnt occur in some small period) + * they should get refused (if .accept() doesnt occur in some small period - + * currently 5 seconds) * * @return a connected I2PSocket * diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManager.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManager.java index d9df5fb3bc..6bde784623 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManager.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManager.java @@ -106,8 +106,10 @@ public class I2PSocketManager implements I2PSessionListener { String id = toString(new byte[] { msg[1], msg[2], msg[3]}); byte[] payload = new byte[msg.length - 4]; System.arraycopy(msg, 4, payload, 0, payload.length); - _log.debug("Message read: type = [" + Integer.toHexString(type) + "] id = [" + getReadableForm(id) - + "] payload length: " + payload.length + "]"); + if (_log.shouldLog(Log.DEBUG)) + _log.debug("Message read: type = [" + Integer.toHexString(type) + + "] id = [" + getReadableForm(id) + + "] payload length: [" + payload.length + "]"); switch (type) { case ACK: ackAvailable(id, payload); @@ -510,8 +512,9 @@ public class I2PSocketManager implements I2PSessionListener { while (iter.hasNext()) { id = (String)iter.next(); sock = (I2PSocketImpl)_inSockets.get(id); - _log.debug("Closing inSocket \"" - + getReadableForm(sock.getLocalID()) + "\""); + if (_log.shouldLog(Log.DEBUG)) + _log.debug("Closing inSocket \"" + + getReadableForm(sock.getLocalID()) + "\""); sock.internalClose(); } @@ -519,8 +522,9 @@ public class I2PSocketManager implements I2PSessionListener { while (iter.hasNext()) { id = (String)iter.next(); sock = (I2PSocketImpl)_outSockets.get(id); - _log.debug("Closing outSocket \"" - + getReadableForm(sock.getLocalID()) + "\""); + if (_log.shouldLog(Log.DEBUG)) + _log.debug("Closing outSocket \"" + + getReadableForm(sock.getLocalID()) + "\""); sock.internalClose(); } } @@ -572,7 +576,8 @@ public class I2PSocketManager implements I2PSessionListener { public void removeSocket(I2PSocketImpl sock) { synchronized (lock) { - _log.debug("Removing socket \"" + getReadableForm(sock.getLocalID()) + "\""); + if (_log.shouldLog(Log.DEBUG)) + _log.debug("Removing socket \"" + getReadableForm(sock.getLocalID()) + "\""); _inSockets.remove(sock.getLocalID()); _outSockets.remove(sock.getLocalID()); lock.notify(); diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketOptions.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketOptions.java index d29360fb1d..58e19b872b 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketOptions.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketOptions.java @@ -2,7 +2,6 @@ package net.i2p.client.streaming; /** * Define the configuration for streaming and verifying data on the socket. - * No options available... * */ public class I2PSocketOptions { -- GitLab