Struct naia_server_socket::Socket
source · pub struct Socket { /* private fields */ }Expand description
Socket is able to send and receive messages from remote Clients
Implementations§
source§impl Socket
impl Socket
sourcepub fn new(config: &SocketConfig) -> Self
pub fn new(config: &SocketConfig) -> Self
Create a new Socket
sourcepub fn listen(&mut self, server_addrs: &ServerAddrs)
pub fn listen(&mut self, server_addrs: &ServerAddrs)
Listens on the Socket for incoming communication from Clients
sourcepub fn packet_sender(&self) -> PacketSender
pub fn packet_sender(&self) -> PacketSender
Gets a PacketSender which can be used to send packets through the Socket
sourcepub fn packet_receiver(&self) -> PacketReceiver
pub fn packet_receiver(&self) -> PacketReceiver
Gets a PacketReceiver which can be used to receive packets from the Socket