pub struct IpConnectionRequestSender { /* private fields */ }
Expand description

The IP connection request sender is a cloneable object created by a IP connection. The sender can send requests to connected devices and can be shared across threads by cloning.

Implementations

Creates a TCP/IP connection to the given addr. addr can be any object which implements ToSocketAddrs, for example a tuple of a hostname and a port. The address can refer to a Brick Daemon or to a WIFI/Ethernet Extension.

Devices can only be controlled when the connection was established successfully.

Blocks until the connection is established and throws an exception if there is no Brick Daemon or WIFI/Ethernet Extension listening at the given host and port.

Disconnects the TCP/IP connection from the Brick Daemon or the WIFI/Ethernet Extension.

This event is triggered whenever the IP Connection got connected to a Brick Daemon or to a WIFI/Ethernet Extension.

This event is triggered whenever the IP Connection got disconnected from a Brick Daemon or to a WIFI/Ethernet Extension.

Returns the timeout as set by set_timeout

Sets the timeout for getters and for setters for which the response expected flag is activated.

Default timeout is 2,5s.

Queries the current connection state.

Returns true if auto-reconnect is enabled, false otherwise.

Enables or disables auto-reconnect. If auto-reconnect is enabled, the IP Connection will try to reconnect to the previously given host and port, if the currently existing connection is lost. Therefore, auto-reconnect only does something after a successful connect call.

Default value is true.

Broadcasts an enumerate request. All devices will respond with an enumerate event.

This receiver receives enumerate events, as described here.

Performs an authentication handshake with the connected Brick Daemon or WIFI/Ethernet Extension. If the handshake succeeds the connection switches from non-authenticated to authenticated state and communication can continue as normal. If the handshake fails then the connection gets closed. Authentication can fail if the wrong secret was used or if authentication is not enabled at all on the Brick Daemon or the WIFI/Ethernet Extension.

See the authentication tutorial for more information.

New in version 2.1.0.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.