Skip to main content

Networked Services

Hydroflow provides a robust framework for developing networked services. The best way to get started is to use the Hydroflow template.

cargo generate hydro-project/hydroflow-template

The template contains a chat server & client implementation using UDP. You can start multiple instances of the client and connect to the same server.

Things to Check

  • README - Contains instructions on building the template and running the client and server examples.
  • server.rs - Contains the chat server implementation. The inline rust documentation explains the networking-related hydroflow operators and their usage.
  • client.rs - Contains the chat client implementation. The inline rust documentation explains the networking-related hydroflow operators and their usage.

Hydroflow also supports TCP for reliable, connection-oriented communication. Understanding the differences and use cases of these protocols can help you choose the right one for your networked service.

Additional Examples

The Hydroflow examples directory contains additional examples that deal with networking. For example, the Randomized Gossip Server example extends the chat example to work with a cluster of redundant servers that use gossip for sharing chat-related state between themselves.