easy_sockets/sockets/
mod.rs

1//! Module which defines means of send and receiving messages through sockets.
2
3pub mod raw_udp;
4pub mod tcp;
5pub mod udp;
6
7/// Largest single message payload
8pub const MAX_PAYLOAD_SIZE: usize = 1450;
9
10/// Determines the socket protocol to be used.
11pub enum SocketType {
12    /// Socket type with features like retransmission and message ordering making it most reliable.
13    /// Best to use if you don not care much about the specific details.
14    TCP,
15    /// Socket type with limited safety features making it inherently unreliable.
16    /// Best to use this if you want to define a fast low level protocol.
17    UDP,
18    /// Socket type with limited safety but with a wider range of function special to UDP.
19    /// Only use this if you need features like multi casting and high flexibility.
20    RawUDP,
21}