Struct udt::Epoll
[−]
[src]
pub struct Epoll { // some fields omitted }
Used with the epoll*
methods of a UDTSocket
Methods
impl Epoll
[src]
fn create() -> Result<Epoll, UdtError>
Creates a new Epoll object
fn add_usock(&mut self, socket: &UdtSocket, events: Option<EpollEvents>) -> Result<(), UdtError>
Adds a UdtSocket to an epoll
events
can be any combination of UDT_EPOLL_IN
, UDT_EPOLL_OUT
, and UDT_EPOLL_ERR
fn remove_usock(&mut self, socket: &UdtSocket) -> Result<(), UdtError>
Removes a UdtSocket from an epoll
If the socket isn't part of the epoll, there is no error
fn wait(&mut self, timeout: i64, write: bool) -> Result<(Vec<UdtSocket>, Vec<UdtSocket>), UdtError>
Wait for events
Timeout is in milliseconds. If negative, wait forever. If zero, return immediately.
If write
is false, the list of sockets for writing will always be null.
Returns
A tuple of sockets to be read and sockets to be written (or have exceptions)