To summarize, the current implementation of JavaOSC is UDP only, and there is a lot of transport-level code (all UDP-specific) in OSCPortIn and OSCPortOut.
I plan to implement TCP support soon, and I want for users to be able to continue to use the same public API, with only the small additional step of setting the network protocol to TCP, something like this:
new OSCPortInBuilder().setPort(12345).setNetworkProtocol(TCP).build();
As a first step towards that, this PR refactors / reorganizes the parts of the codebase that have to do with transport. The next step will be to simply add a TCPTransport class and OSCPort{In,Out}Builder methods to allow the user to specify the network protocol.
Summary of changes
BREAKING Move higher-level transport.udp.OSCPort* classes up a level to transport.OSCPort*.
Most of the code in these classes has nothing to do with UDP transport specifically, and is more about the transport of OSC messages at a higher level.
Added a Transport interface that captures the low level implementation details.
Moved the current UDP transport implementation into UDPTransport, which implements Transport.
Adjusted the toString implementations of OSCPort et al to include information about the Transport.
OSCParseExceptions now include the data we attempted to parse
Background
See my comment here: https://github.com/hoijui/JavaOSC/issues/12#issuecomment-559085565
To summarize, the current implementation of JavaOSC is UDP only, and there is a lot of transport-level code (all UDP-specific) in OSCPortIn and OSCPortOut.
I plan to implement TCP support soon, and I want for users to be able to continue to use the same public API, with only the small additional step of setting the network protocol to TCP, something like this:
As a first step towards that, this PR refactors / reorganizes the parts of the codebase that have to do with transport. The next step will be to simply add a TCPTransport class and OSCPort{In,Out}Builder methods to allow the user to specify the network protocol.
Summary of changes
BREAKING Move higher-level
transport.udp.OSCPort*
classes up a level totransport.OSCPort*
.Added a Transport interface that captures the low level implementation details.
Moved the current UDP transport implementation into UDPTransport, which implements Transport.
Adjusted the
toString
implementations of OSCPort et al to include information about the Transport.OSCParseExceptions now include the data we attempted to parse
Feedback welcome! :slightly_smiling_face: