logging, javadoc

This commit is contained in:
jrandom
2004-05-07 01:45:12 +00:00
committed by zzz
parent a82b951aff
commit 766c12242e
3 changed files with 14 additions and 9 deletions

View File

@ -38,7 +38,8 @@ class I2PServerSocketImpl implements I2PServerSocket {
/** /**
* Waits for the next socket connecting. If a remote user tried to make a * 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, * 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 * @return a connected I2PSocket
* *

View File

@ -106,8 +106,10 @@ public class I2PSocketManager implements I2PSessionListener {
String id = toString(new byte[] { msg[1], msg[2], msg[3]}); String id = toString(new byte[] { msg[1], msg[2], msg[3]});
byte[] payload = new byte[msg.length - 4]; byte[] payload = new byte[msg.length - 4];
System.arraycopy(msg, 4, payload, 0, payload.length); System.arraycopy(msg, 4, payload, 0, payload.length);
_log.debug("Message read: type = [" + Integer.toHexString(type) + "] id = [" + getReadableForm(id) if (_log.shouldLog(Log.DEBUG))
+ "] payload length: " + payload.length + "]"); _log.debug("Message read: type = [" + Integer.toHexString(type)
+ "] id = [" + getReadableForm(id)
+ "] payload length: [" + payload.length + "]");
switch (type) { switch (type) {
case ACK: case ACK:
ackAvailable(id, payload); ackAvailable(id, payload);
@ -510,8 +512,9 @@ public class I2PSocketManager implements I2PSessionListener {
while (iter.hasNext()) { while (iter.hasNext()) {
id = (String)iter.next(); id = (String)iter.next();
sock = (I2PSocketImpl)_inSockets.get(id); sock = (I2PSocketImpl)_inSockets.get(id);
_log.debug("Closing inSocket \"" if (_log.shouldLog(Log.DEBUG))
+ getReadableForm(sock.getLocalID()) + "\""); _log.debug("Closing inSocket \""
+ getReadableForm(sock.getLocalID()) + "\"");
sock.internalClose(); sock.internalClose();
} }
@ -519,8 +522,9 @@ public class I2PSocketManager implements I2PSessionListener {
while (iter.hasNext()) { while (iter.hasNext()) {
id = (String)iter.next(); id = (String)iter.next();
sock = (I2PSocketImpl)_outSockets.get(id); sock = (I2PSocketImpl)_outSockets.get(id);
_log.debug("Closing outSocket \"" if (_log.shouldLog(Log.DEBUG))
+ getReadableForm(sock.getLocalID()) + "\""); _log.debug("Closing outSocket \""
+ getReadableForm(sock.getLocalID()) + "\"");
sock.internalClose(); sock.internalClose();
} }
} }
@ -572,7 +576,8 @@ public class I2PSocketManager implements I2PSessionListener {
public void removeSocket(I2PSocketImpl sock) { public void removeSocket(I2PSocketImpl sock) {
synchronized (lock) { 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()); _inSockets.remove(sock.getLocalID());
_outSockets.remove(sock.getLocalID()); _outSockets.remove(sock.getLocalID());
lock.notify(); lock.notify();

View File

@ -2,7 +2,6 @@ package net.i2p.client.streaming;
/** /**
* Define the configuration for streaming and verifying data on the socket. * Define the configuration for streaming and verifying data on the socket.
* No options available...
* *
*/ */
public class I2PSocketOptions { public class I2PSocketOptions {