pub struct RaknetListener { /* private fields */ }Expand description
A RakNet UDP server that accepts incoming connections.
Implementations§
Source§impl RaknetListener
impl RaknetListener
Sourcepub async fn bind(sockaddr: &SocketAddr) -> Result<Self>
pub async fn bind(sockaddr: &SocketAddr) -> Result<Self>
Bind a RakNet listener to the specified UDP address.
Call listen before accepting connections.
Sourcepub async fn from_std(socket: UdpSocket) -> Result<Self>
pub async fn from_std(socket: UdpSocket) -> Result<Self>
Creates a listener from a standard UDP socket.
Sourcepub async fn listen(&mut self)
pub async fn listen(&mut self)
Start receiving connection requests.
Call this before accept. Repeated calls have no effect.
Sourcepub async fn accept(&mut self) -> Result<RaknetSocket>
pub async fn accept(&mut self) -> Result<RaknetSocket>
Sourcepub fn get_guid(&self) -> u64
pub fn get_guid(&self) -> u64
Get the GUID, a random number that uniquely identifies the listener instance.
Sourcepub async fn set_motd(
&mut self,
server_name: &str,
max_connection: u32,
mc_protocol_version: &str,
mc_version: &str,
game_type: &str,
port: u16,
) -> Result<()>
pub async fn set_motd( &mut self, server_name: &str, max_connection: u32, mc_protocol_version: &str, mc_version: &str, game_type: &str, port: u16, ) -> Result<()>
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Sourcepub async fn set_full_motd(&mut self, motd: String) -> Result<()>
pub async fn set_full_motd(&mut self, motd: String) -> Result<()>
pub async fn get_peer_raknet_version(&self, peer: &SocketAddr) -> Result<u8>
Trait Implementations§
Source§impl Drop for RaknetListener
impl Drop for RaknetListener
Auto Trait Implementations§
impl !RefUnwindSafe for RaknetListener
impl !UnwindSafe for RaknetListener
impl Freeze for RaknetListener
impl Send for RaknetListener
impl Sync for RaknetListener
impl Unpin for RaknetListener
impl UnsafeUnpin for RaknetListener
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more