Struct scaproust::Socket [] [src]

pub struct Socket { /* fields omitted */ }

Socket is what applications use to exchange messages.

It is an abstraction of an application's "connection" to a messaging topology. Applications can have more than one Socket open at a time.

Methods

impl Socket
[src]

[src]

Creates a poll request that can be used to initialize a probe. The probe will then allow polling a group of sockets

[src]

Adds a remote endpoint to the socket. The library would then try to connect to the specified remote endpoint. The addr argument consists of two parts as follows: transport://address. The transport specifies the underlying transport protocol to use. The meaning of the address part is specific to the underlying transport protocol. Note that bind and connect may be called multiple times on the same socket, thus allowing the socket to communicate with multiple heterogeneous endpoints. On success, returns an Endpoint that can be later used to remove the endpoint from the socket.

[src]

Adds a local endpoint to the socket. The endpoint can be then used by other applications to connect to. The addr argument consists of two parts as follows: transport://address. The transport specifies the underlying transport protocol to use. The meaning of the address part is specific to the underlying transport protocol. Note that bind and connect may be called multiple times on the same socket, thus allowing the socket to communicate with multiple heterogeneous endpoints. On success, returns an Endpoint that can be later used to remove the endpoint from the socket.

[src]

Sends a buffer. Which of the peers the buffer will be sent to is determined by the protocol.

[src]

Sends a message. Which of the peers the message will be sent to is determined by the protocol.

[src]

Non-blocking version of the send method.

[src]

Non-blocking version of the send_msg method.

[src]

Receives a buffer.

[src]

Receives a message.

[src]

Non-blocking version of the recv method.

[src]

Non-blocking version of the recv_msg method.

[src]

Sets the timeout for send operation on the socket.
If message cannot be sent within the specified timeout, an error with the kind TimedOut is returned. None means infinite timeout. Default value is None.

[src]

Sets the timeout for recv operation on the socket.
If message cannot be received within the specified timeout, an error with the kind TimedOut is returned. None value means infinite timeout. Default value is None.

[src]

Sets outbound priority for endpoints subsequently added to the socket.
This option has no effect on socket types that send messages to all the peers.
However, if the socket type sends each message to a single peer (or a limited set of peers), peers with high priority take precedence over peers with low priority. Highest priority is 1, lowest priority is 16. Default value is 8.

[src]

Sets inbound priority for endpoints subsequently added to the socket.
This option has no effect on socket types that are not able to receive messages.
When receiving a message, messages from peer with higher priority are received before messages from peer with lower priority. Highest priority is 1, lowest priority is 16. Default value is 8.

[src]

This option, when set to true, disables Nagle’s algorithm. It also disables delaying of TCP acknowledgments. Using this option improves latency at the expense of throughput. Default value is false.

[src]

Sets a socket option. See ConfigOption to get the list of options.

Trait Implementations

impl Drop for Socket
[src]

[src]

Executes the destructor for this type. Read more