Struct minetest_protocol::services::socket::MinetestSocket
source · pub struct MinetestSocket { /* private fields */ }
Expand description
MinetestSocket
Handles the raw UDP socket, protocol validation, separating packets by peer, reliable packet send, and split packets.
The actual contents of the communication, including authentication/handshaking, are not handled at this layer.
Implementations§
source§impl MinetestSocket
impl MinetestSocket
sourcepub async fn new(bind_addr: SocketAddr, for_server: bool) -> Result<Self, Error>
pub async fn new(bind_addr: SocketAddr, for_server: bool) -> Result<Self, Error>
Create a new MinetestSocket and bind to address. The address may be V4 or V6. To select a random bind port, use 0.0.0.0:0 or [::]:0