pub struct NetworkSession<Rx, Tx, C, const N: usize>{ /* private fields */ }
Expand description
A session with the typical network operations.
Implementations§
Source§impl<Rx, Tx, C, const N: usize> NetworkSession<Rx, Tx, C, N>
impl<Rx, Tx, C, const N: usize> NetworkSession<Rx, Tx, C, N>
Sourcepub fn listen(&mut self, port: u16) -> Result<()>
pub fn listen(&mut self, port: u16) -> Result<()>
Begins to listen to the incoming TCP connections on the specified port.
Sourcepub fn connect(&mut self, link_id: usize, address: SocketAddr) -> Result<()>
pub fn connect(&mut self, link_id: usize, address: SocketAddr) -> Result<()>
Establishes a TCP connection with the specified IP address, link identifier will be associated with the given IP address. Then it will be possible to send data using this link ID.
Sourcepub fn poll_network_event(&mut self) -> Result<NetworkEvent<'_, N>, Error>
pub fn poll_network_event(&mut self) -> Result<NetworkEvent<'_, N>, Error>
Non-blocking polling to get a new network event.
Trait Implementations§
Auto Trait Implementations§
impl<Rx, Tx, C, const N: usize> Freeze for NetworkSession<Rx, Tx, C, N>
impl<Rx, Tx, C, const N: usize> RefUnwindSafe for NetworkSession<Rx, Tx, C, N>
impl<Rx, Tx, C, const N: usize> Send for NetworkSession<Rx, Tx, C, N>
impl<Rx, Tx, C, const N: usize> Sync for NetworkSession<Rx, Tx, C, N>
impl<Rx, Tx, C, const N: usize> Unpin for NetworkSession<Rx, Tx, C, N>
impl<Rx, Tx, C, const N: usize> UnwindSafe for NetworkSession<Rx, Tx, C, N>
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