Struct lazy_socket::raw::Socket [] [src]

pub struct Socket { /* fields omitted */ }

Raw socket

Methods

impl Socket
[src]

Initializes new socket.

Corresponds to C connect()

Returns underlying socket descriptor.

Note: ownership is not transferred.

Retrieves socket name i.e. address

Wraps getsockname()

Available for binded/connected sockets.

Binds socket to address.

Listens for incoming connections on this socket.

Receives some bytes from socket

Number of received bytes is returned on success

Receives some bytes from socket

Number of received bytes and remote address are returned on success.

Sends some bytes through socket.

Number of sent bytes is returned.

Sends some bytes through socket toward specified peer.

Number of sent bytes is returned.

Note: the socket will be bound, if it isn't already. Use method name to determine address.

Accepts incoming connection.

Connects socket with remote address.

Retrieves socket option.

Sets socket option

Value is generally integer or C struct.

Sets I/O parameters of socket.

It uses ioctlsocket under hood.

Sets non-blocking mode.

Stops receive and/or send over socket.

Closes socket.

Note: on Drop socket will be closed on its own. There is no need to close it explicitly.

Trait Implementations

impl Drop for Socket
[src]

A method called when the value goes out of scope. Read more

impl AsRawFd for Socket
[src]

Extracts the raw file descriptor. Read more

impl FromRawFd for Socket
[src]

Constructs a new instance of Self from the given raw file descriptor. Read more

impl IntoRawFd for Socket
[src]

Consumes this object, returning the raw underlying file descriptor. Read more