Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0.3-alpha
-
None
-
None
-
Reviewed
Description
Encapsulate connections to peers into the Peer and PeerServer classes. Since many Java classes may be involved with these connections, it makes sense to create a container for them. For example, a connection to a peer may have an input stream, output stream, readablebytechannel, encrypted output stream, and encrypted input stream associated with it.
This makes us less dependent on the NetUtils methods which use instanceof to manipulate socket and stream states based on the runtime type. it also paves the way to introduce UNIX domain sockets which don't inherit from java.net.Socket.