Struct utp2::UtpSocket
[−]
[src]
pub struct UtpSocket { /* fields omitted */ }
Methods
impl UtpSocket
[src]
fn bind(addr: &SocketAddr) -> Result<(UtpSocket, UtpListener)>
Bind a new UtpSocket
to the given socket address
fn local_addr(&self) -> Result<SocketAddr>
fn from_socket(socket: UdpSocket) -> (UtpSocket, UtpListener)
Create a new Utpsocket
backed by the provided UdpSocket
.
fn connect(&self, addr: &SocketAddr) -> Result<UtpStream>
Connect a new UtpSocket
to the given remote socket address
fn ready(&self, ready: Ready) -> Result<()>
Called whenever the socket readiness changes
fn tick(&self) -> Result<()>
This function should be called every 500ms
Trait Implementations
impl Evented for UtpSocket
[src]
fn register(
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
Register self
with the given Poll
instance. Read more
fn reregister(
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
Re-register self
with the given Poll
instance. Read more
fn deregister(&self, poll: &Poll) -> Result<()>
Deregister self
from the given Poll
instance Read more