CppWAMP
C++11 client library for the WAMP protocol
|
Contains TCP host address information, as well as other socket options. More...
#include <cppwamp/tcphost.hpp>
Public Member Functions | |
TcpHost (std::string hostName, std::string serviceName, TcpOptions options={}, RawsockMaxLength maxRxLength=defaultMaxRxLength) | |
Constructor taking a service string. More... | |
TcpHost (std::string hostName, unsigned short port, TcpOptions options={}, RawsockMaxLength maxRxLength=defaultMaxRxLength) | |
Constructor taking a numeric port number. More... | |
TcpHost & | withOptions (TcpOptions options) |
Specifies the socket options to use. | |
TcpHost & | withMaxRxLength (RawsockMaxLength length) |
Specifies the maximum length permitted for incoming messages. | |
const std::string & | hostName () const |
Obtains the TCP host name. | |
const std::string & | serviceName () const |
Obtains the TCP service name, or stringified port number. | |
const TcpOptions & | options () const |
Obtains the transport options. | |
RawsockMaxLength | maxRxLength () const |
Obtains the specified maximum incoming message length. | |
TcpHost & | withBroadcast (bool enabled=true) |
The following setters are deprecated. More... | |
TcpHost & | withDebug (bool enabled=true) |
Adds the SO_DEBUG socket option. More... | |
TcpHost & | withDoNotRoute (bool enabled=true) |
Adds the SO_DONTROUTE socket option. More... | |
TcpHost & | withKeepAlive (bool enabled=true) |
Adds the SO_KEEPALIVE socket option. More... | |
TcpHost & | withLinger (bool enabled, int timeout) |
Adds the SO_LINGER socket option. More... | |
TcpHost & | withOutOfBandInline (bool enabled) |
Adds the SO_OOBINLINE socket option. More... | |
TcpHost & | withReceiveBufferSize (int size) |
Adds the SO_RCVBUF socket option. More... | |
TcpHost & | withReceiveLowWatermark (int size) |
Adds the SO_RCVLOWAT socket option. More... | |
TcpHost & | withReuseAddress (bool enabled=true) |
Adds the SO_REUSEADDR socket option. More... | |
TcpHost & | withSendBufferSize (int size) |
Adds the SO_SNDBUF socket option. More... | |
TcpHost & | withSendLowWatermark (int size) |
Adds the SO_SNDLOWAT socket option. More... | |
TcpHost & | withUnicastHops (int hops) |
Adds the IP_UNICAST_TTL socket option. More... | |
TcpHost & | withIpV6Only (bool enabled=true) |
Adds the IP_V6ONLY socket option. More... | |
TcpHost & | withNoDelay (bool enabled=true) |
Adds the TCP_NODELAY socket option. More... | |
Static Public Attributes | |
static constexpr RawsockMaxLength | defaultMaxRxLength |
The default maximum length permitted for incoming messages. | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename TCodec > | |
Connector::Ptr | connector (AnyIoExecutor exec, TcpHost host) |
Creates a Connector that can establish a TCP raw socket transport. More... | |
template<typename TCodec , typename TExecutionContext > | |
Connector::Ptr | connector (TExecutionContext &context, TcpHost host) |
Creates a Connector that can establish a TCP raw socket transport. More... | |
template<typename TCodec , typename TExecutionContext > | |
Connector::Ptr | connector (TExecutionContext &context, UdsPath path) |
Creates a Connector that can establish a TCP raw socket transport. More... | |
Contains TCP host address information, as well as other socket options.
wamp::TcpHost::TcpHost | ( | std::string | hostName, |
std::string | serviceName, | ||
TcpOptions | options = {} , |
||
RawsockMaxLength | maxRxLength = defaultMaxRxLength |
||
) |
Constructor taking a service string.
hostName | URL or IP of the router to connect to. |
serviceName | Service name or stringified port number. |
options | Socket options. |
maxRxLength | Maximum inbound message length |
wamp::TcpHost::TcpHost | ( | std::string | hostName, |
unsigned short | port, | ||
TcpOptions | options = {} , |
||
RawsockMaxLength | maxRxLength = defaultMaxRxLength |
||
) |
Constructor taking a numeric port number.
hostName | URL or IP of the router to connect to. |
port | Port number. |
options | TCP socket options. |
maxRxLength | Maximum inbound message length |
|
inline |
The following setters are deprecated.
Socket options should be passed via the constructor or set via TcpHost::withOptions. Adds the SO_BROADCAST socket option.
|
inline |
Adds the SO_DEBUG socket option.
|
inline |
Adds the SO_DONTROUTE socket option.
|
inline |
Adds the SO_KEEPALIVE socket option.
|
inline |
Adds the SO_LINGER socket option.
|
inline |
Adds the SO_OOBINLINE socket option.
|
inline |
Adds the SO_RCVBUF socket option.
|
inline |
Adds the SO_RCVLOWAT socket option.
|
inline |
Adds the SO_REUSEADDR socket option.
|
inline |
Adds the SO_SNDBUF socket option.
|
inline |
Adds the SO_SNDLOWAT socket option.
|
inline |
Adds the IP_UNICAST_TTL socket option.
|
inline |
Adds the IP_V6ONLY socket option.
|
inline |
Adds the TCP_NODELAY socket option.
|
related |
Creates a Connector that can establish a TCP raw socket transport.
This overload takes an executor that is convertible to the boost::asio::any_io_executor polymorphic wrapper.
std::shared_ptr
to a Connector TCodec | The serialization to use over this transport. |
exec | The executor to be used by the transport. |
host | TCP host address and other socket options. |
|
related |
Creates a Connector that can establish a TCP raw socket transport.
Only participates in overload resolution when isExecutionContext<TExecutionContext>() == true
std::shared_ptr
to a Connector TCodec | The serialization to use over this transport. |
TExecutionContext | The given execution context type (deduced). |
context | The I/O context containing the executor to be used by the transport. |
host | TCP host address and other socket options. |
|
related |
Creates a Connector that can establish a TCP raw socket transport.
Only participates in overload resolution when isExecutionContext<TExecutionContext>() == true
std::shared_ptr
to a Connector TCodec | The serialization to use over this transport. |
TExecutionContext | The given execution context type (deduced). |
context | The I/O context containing the executor to be used by the transport. |
path | Unix domain socket path and other socket options. |