Trait miow::net::TcpBuilderExt [] [src]

pub trait TcpBuilderExt {
    unsafe fn connect_overlapped(&self,
                                 addr: &SocketAddr,
                                 overlapped: &mut Overlapped)
                                 -> Result<(TcpStream, bool)>; }

Additional methods for the TcpBuilder type in the net2 library.

Required Methods

Attempt to consume the internal socket in this builder by executing an overlapped connect operation.

This function will issue a connect operation to the address specified on the underlying socket, flagging it as an overlapped operation which will complete asynchronously. If successful this function will return the corresponding TCP stream.

This function will also return whether the connect immediately succeeded or not. If false is returned then the I/O operation is still pending and will complete at a later date.

Note that to succeed this requires that the underlying socket has previously been bound via a call to bind to a local address.

Unsafety

This function is unsafe because the kernel requires that the overlapped pointer is valid until the end of the I/O operation. The kernel also requires that overlapped is unique for this I/O operation and is not in use for any other I/O.

To safely use this function callers must ensure that this pointer is valid until the I/O operation is completed, typically via completion ports and waiting to receive the completion notification on the port.

Implementors