Closed wvengen closed 2 years ago
Given the signature of decode
and encode rosc
is actually transport agnostic since it consumes and produces slices of bytes. I guess the spec proposes to send the size of each packet when using TCP in case you want to send more than one OSC package/message over one TCP connection. It would likely be beneficial if rosc
would provide some higher level networking abstractions but I lost track of how one is now doing proper networking with Rust when the whole asyncio thing happenend.
Thanks for your response!
I understand you've left out the networking part from rosc
, I think that's fine. Someone else could provide a crate integrating rosc
with a certain approach to networking. The existing examples here are helpful already for people wanting to use this.
Perhaps something like fn decode_tcp(msgs: &[u8]) -> Result<Vec<OscPacket>>
and fn encode_tcp(packets: &Vec<OscPacket>) -> Result<Vec<u8>>
would still be useful. (Though I'm not sure if it should be &Vec<OscPacket>
or Vec<&OscPacket>
.)
Perhaps something like fn decode_tcp(msgs: &[u8]) -> Result<Vec
> and fn encode_tcp(packets: &Vec ) -> Result<Vec > would still be useful. (Though I'm not sure if it should be &Vec or Vec<&OscPacket>.)
Yes, this would be helpful when interacting with other OSC implementations over TCP which follow the spec closely. Would you mind to contribute an implementation of those two functions? I can implement this as well but cannot guarantee when I will find the time to do that.
This got finally resolved with #21 , but there is no release yet. A proper release will follow as soon as we removed the dependency on the regex crate.
When working with TCP, the OSC spec mentions:
I've had much trouble with rosc to use TCP, reading this little line in the spec I finally understand. Is it true that rosc doesn't implement this right now, and if so, would this be a good idea to have?