On Sun, 2003-10-12 at 21:33, Zlatin Balevsky wrote: > OCM lists some connections as incoming at port -2, -1... > > -1 208.39.42.23:35634 0 2,493 Bytes - None 0 s 1 s > 35713 207.32.9.50:11975 366 299 KiB - 294 KiB 0 s > 6:46 > -2 207.32.9.50:11975 0 None - None 1:50 1:50
> and here's one that has had some data on it:
> -1 67.80.241.230:2366 4 541 Bytes - None 0 s 10:36
>
-1 means that ConnectionHandler.conn == null.
-2 means that conn.getSocket() threw an IOException.
conn is the tcpConnection member of the ConnectionHandler instance.
If conn turns out to be null during construction of the CH, you
get that "Already closed!" traceback.
Apparently this happens when the other end closes the TCP connection
very rapidly or else this end was slow in running the constructor.
So -1 must mean the other end has closed the TCP connection, and Fred
noticed the status on the read/write to the socket and set conn to
null, but OCM hasn't gotten a chance to tear down the freenet
connection.
Probably -2 means Fred hasn't noticed it at all yet, i.e. hasn't
selected the file descriptor of the socket and tried to read it,
but when it tried to do a getSocket, this gave an exception.
public int getLocalPort() {
tcpConnection c = conn;
java.net.Socket sock;
if (c == null) return -1;
try {
sock = conn.getSocket();
} catch (IOException e) {
return -2;
}
if(sock == null) return -3;
return sock.getLocalPort();
}
-- Ed Huff
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Devl mailing list [EMAIL PROTECTED] http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/devl
