[Review] Some TCP protocol implementation

Hello, and thanks for your work with Rust, and its community.

I've written my first crate (more of a toy project at the moment) that allows to connect, in Rust, to Vert.x TCP Event bus bridge. Sounded like a good fit for a first Rust project past the "tutorial level", networking, in/out bound communications, messages as ADTs, serde, etc.

I ended up with this: https://github.com/aesteve/vertx-eventbus-client-rs which is a working implementation (needs to launch a java jar to run the tests against a real Vert.x TCP bridge, but that shouldn't be an issue for a simple code review). Long story short, Vert.x is to the JVM what Node.js could be to the JS world: async, event-loop, etc. But also has an "Event-Bus" as internal messaging system. This EventBus can be "bridged" to a TCP connection, so that other applications can have access to it. It's a very simple protocol (big endian size, then JSON message) with very few messages. Not really complicated to understand/implement.

What I'm really interested in is the design from a crate user point of view, or terrible misconceptions or obnoxious design. Not that much interested in performances, i'll come to it later in my Rust baby-steps, probably.

Even though the current implementation is working, I feel the design isn't really satisfying. I've already received some very good and useful comments on Gitter (thank you so much, once again) and added issues to address them.

What do you think of the overall design, or even better: how would you have designed it?

Thanks a lot for your time in advance, and thank you to the whole Rust community. Making progress over the past weeks has been really a nice journey.

EDIT: this issue tracks design, or pointers that could be interesting.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.