Crate udp_connector

source ·
Expand description

A generic eventually-correct framework over unreliable connections, such as UDP.

This crate uses a struct called Connector that eventually guarantees that all persistent messages arrive at the other end, or it will disconnect.

This crate differentiates between two message types:

  • Confirmed: This is a message that is:
    • Guaranteed to arrive at some point
    • Not guaranteed to arrive in the correct order
  • Unconfirmed: This is a message that is not guaranteed to arrive

Use cases can be:

  • Sending player data does not always have to arrive, because the location is updated 10 times a second (unconfirmed)
  • Login information should always arrive, but this can take a second (confirmed)

Structs

The connector is used to handle handshakes and timeouts with a different, remote connector

Enums

The state of the connector. This is based on when the last ping was send or received. Changing your ConnectorParam will greatly affect the results of Connector.state(), returning this value.

Traits

Settings that are set up for a Connector. This can be used to tweak your Connector at compile-time
A generic trait over a socket. This is automatically implemented for UdpSocket but can be implemented for your own connector as well.

Type Definitions

The result that is used in this type. It is a simple wrapper around Result<T, failure::Error>