Struct abbegm::sync_peer::EgmPeer [−][src]
pub struct EgmPeer { /* fields omitted */ }
Expand description
Blocking EGM peer for sending and receiving messages over UDP.
Implementations
Wrap an existing UDP socket in a peer.
If you want to use the EgmPeer::recv
and EgmPeer::send
functions,
you should use an already connected socket.
Otherwise, you can only use EgmPeer::recv_from
and EgmPeer::send_to
.
Create an EGM peer on a newly bound UDP socket.
The socket will not be connected to a remote peer,
so you can only use EgmPeer::recv_from
and EgmPeer::send_to
.
Get an exclusive reference to the inner socket.
Consume self and get the inner socket.
Receive a message from the remote address to which the inner socket is connected.
To use this function, you must pass an already connected socket to EgmPeer::new
.
If the peer was created with an unconnected socket, this function will panic.
Receive a message from any remote address.
Purge all messages from the socket read queue.
Useful to ignore old messages when the socket has been left unpolled for a while.
This will leave the socket in blocking mode when the purging is done.
Send a message to the remote address to which the inner socket is connected.
To use this function, you must pass an already connected socket to EgmPeer::new
.
If the peer was created with an unconnected socket, this function will panic.