pub trait PacketSender:
PacketSenderClone
+ Send
+ Sync {
// Required methods
fn send(&self, payload: &[u8]) -> Result<(), NaiaClientSocketError>;
fn server_addr(&self) -> ServerAddr;
fn connected(&self) -> bool;
fn disconnect(&mut self);
}Expand description
Used to send packets from the Client Socket
Required Methods§
Sourcefn send(&self, payload: &[u8]) -> Result<(), NaiaClientSocketError>
fn send(&self, payload: &[u8]) -> Result<(), NaiaClientSocketError>
Sends a packet from the Client Socket
Sourcefn server_addr(&self) -> ServerAddr
fn server_addr(&self) -> ServerAddr
Get the Server’s Socket address
Sourcefn disconnect(&mut self)
fn disconnect(&mut self)
Disconnect the Client Socket