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
sourceimpl 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
Auto Trait Implementations
impl !RefUnwindSafe for Socket
impl Send for Socket
impl Sync for Socket
impl Unpin for Socket
impl !UnwindSafe for Socket
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more