C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::net::tcp_stream_socket Struct Reference

Represents a TCP connection. More...

#include <tcp_stream_socket.hpp>

Inheritance diagram for caf::net::tcp_stream_socket:
caf::net::stream_socket caf::net::network_socket caf::net::socket caf::detail::comparable< socket >

Public Types

using super = stream_socket
 
- Public Types inherited from caf::net::stream_socket
using super = network_socket
 The parent type.
 
using transport_type = octet_stream::transport
 The default transport for exchanging raw bytes over a stream socket.
 
- Public Types inherited from caf::net::network_socket
using super = socket
 

Related Symbols

(Note that these are not member symbols.)

expected< tcp_stream_socket > CAF_NET_EXPORT make_connected_tcp_stream_socket (ip_endpoint node, timespan timeout=infinite)
 Creates a tcp_stream_socket connected to given remote node.
 
expected< tcp_stream_socket > CAF_NET_EXPORT make_connected_tcp_stream_socket (const uri::authority_type &auth, timespan timeout=infinite)
 Creates a tcp_stream_socket connected to auth.
 
expected< tcp_stream_socket > CAF_NET_EXPORT make_connected_tcp_stream_socket (std::string host, uint16_t port, timespan timeout=infinite)
 Creates a tcp_stream_socket connected to given host and port.
 

Additional Inherited Members

- Public Member Functions inherited from caf::net::stream_socket
constexpr stream_socket fd () const noexcept
 
- Public Member Functions inherited from caf::net::socket
constexpr socket (socket_id id) noexcept
 
constexpr socket (const socket &other) noexcept=default
 
socketoperator= (const socket &other) noexcept=default
 
constexpr signed_socket_id compare (socket other) const noexcept
 
constexpr operator bool () const noexcept
 
constexpr bool operator! () const noexcept
 
constexpr socket fd () const noexcept
 
- Public Attributes inherited from caf::net::socket
socket_id id
 

Detailed Description

Represents a TCP connection.

Friends And Related Symbol Documentation

◆ make_connected_tcp_stream_socket() [1/3]

expected< tcp_stream_socket > CAF_NET_EXPORT make_connected_tcp_stream_socket ( const uri::authority_type & auth,
timespan timeout = infinite )
related

Creates a tcp_stream_socket connected to auth.

Parameters
authHost and port of the remote node.
timeoutMaximum waiting time on the connection before canceling it.
Returns
The connected socket or an error.
Note
The timeout applies to a single connection attempt. If the DNS lookup for auth returns more than one possible IP address then the timeout applies to each connection attempt individually. For example, passing a timeout of one second with a DNS result of five entries would mean this function can block up to five seconds if all attempts time out.

◆ make_connected_tcp_stream_socket() [2/3]

expected< tcp_stream_socket > CAF_NET_EXPORT make_connected_tcp_stream_socket ( ip_endpoint node,
timespan timeout = infinite )
related

Creates a tcp_stream_socket connected to given remote node.

Parameters
nodeHost and port of the remote node.
timeoutMaximum waiting time on the connection before canceling it.
Returns
The connected socket or an error.

◆ make_connected_tcp_stream_socket() [3/3]

expected< tcp_stream_socket > CAF_NET_EXPORT make_connected_tcp_stream_socket ( std::string host,
uint16_t port,
timespan timeout = infinite )
related

Creates a tcp_stream_socket connected to given host and port.

Parameters
hostTCP endpoint for connecting to.
portTCP port of the server.
timeoutMaximum waiting time on the connection before canceling it.
Returns
The connected socket or an error.
Note
The timeout applies to a single connection attempt. If the DNS lookup for auth returns more than one possible IP address then the timeout applies to each connection attempt individually. For example, passing a timeout of one second with a DNS result of five entries would mean this function can block up to five seconds if all attempts time out.

The documentation for this struct was generated from the following file: