NetworkStream: simplify, add Logger, getRemoteAddress(), better cleanup and closing...
authorEddie <dev@fun2be.me>
Sat, 6 Jun 2015 08:43:34 +0000 (09:43 +0100)
committerEddie <dev@fun2be.me>
Sat, 6 Jun 2015 09:36:54 +0000 (10:36 +0100)
commitaa2233c2ba4ce9b2aaa4c447f8709e13acc82deb
tree76e77f94bd498dfbb021f3d6e0156c0a73d9416e
parentd802175752a0f3854f856a7efea00cdd1b967fa0
NetworkStream: simplify, add Logger, getRemoteAddress(), better cleanup and closing, javadocs

 * simplify object deserialization
 * support using application's Logger instance
 * introduce getRemoteAddress()
 * introduce close() and move close streams to done()
 * fill out javadocs

Simplify object deserialization. Remove the now unused object length
functionality that was originally prefixed to the object in the serialized stream.
This allows the dropping of the indirect streams used to measure the
size of an object.

Logger. Pass in the application Logger instance to the constructor, add
the project-standardised simple logp() method and use it in place of
console error messages.

Introduce getRemoteAddress(). Provide public access to the stream's
remote host address so that NetworkMessage can be tagged with the
sender's address for easy ServiceAddressMap support.

Introduce close(). Provide public access to tell the stream to close
cleanly. Used by the NetworkStreamManager to close all streams cleanly
at shutdown.
Move the stream closing code into done().
src/uk/ac/ntu/n0521366/wsyd/libs/net/NetworkStream.java