If the frame happens to be exactly the same size as the buffer capacity, we
will erroneously think that the last frame was complete because the limit is
normally at the buffer capacity.
This only exploded when we had both a perfectly sized frame and failed to read
it in a single call to read, which apparently took 17 years to happen, and many
billions of frames read.
Sometimes a present node uses a port to connect outwards that another
node is listening on.. I considered building-in some smarts for this
into the peer stuff, but for now at least I'll keep it simpler and
more flexible.
This reverts commit ec47182263.
Ummm? I misread the code? So embarassing. For some reason I thought it
was using the public hostname for all connections. Perhaps I misread
the 'hostName' local variable in a PeerNode method for the 'hostName'
in the record.
We can't include things with unpredictable iteration order (sets, maps) in our
wire test, but we still want to test those things in our GIANT STREAMABLE CLASS
OF DOOM test. So we now have a separate wire format test which just ensures
that we don't spuriously break the encoding of things that should be
predictable.
If we're going to tell you to use an ArrayList instead of toArray(), let's make
that easy. This would be unnecessary if there was an ArrayList constructor that
took Iterable, but there isn't. And DSet is not a Collection.
Every time a client logs on and back off, another DatagramReader thread
is left around. This seems to fix it, but this method should be called
when either the reader or writer shut down..
Also: the didExit methods look funny:
/**
* Callback called by the datagram writer thread when it goes away.
*/
protected synchronized void datagramWriterDidExit ()
{
// clear out our writer reference
_datagramWriter = null;
if (_datagramReader == null) {
closeDatagramChannel();
}
log.debug("Datagram writer thread exited.");
}
Why would it only try to shut things down if there's no reader?
Perhaps the idea here is that it won't shut down the channel until
both the reader and writer exit? It's not documented...