Robot Raconteur Core C++ Library
Public Member Functions | List of all members
RobotRaconteur::TcpTransport Class Reference

Transport for Transport Control Protocol Internet Protocol (TCP/IP) networks. More...

Inheritance diagram for RobotRaconteur::TcpTransport:
RobotRaconteur::Transport

Public Member Functions

 TcpTransport (const boost::shared_ptr< RobotRaconteurNode > &node=RobotRaconteurNode::sp())
 Construct a new TcpTransport. More...
 
virtual int32_t GetDefaultReceiveTimeout ()
 Get the default receive timeout. More...
 
virtual void SetDefaultReceiveTimeout (int32_t milliseconds)
 Set the default receive timeout. More...
 
virtual int32_t GetDefaultConnectTimeout ()
 Get the default connect timeout. More...
 
virtual void SetDefaultConnectTimeout (int32_t milliseconds)
 Set the default connect timeout. More...
 
virtual void StartServer (int32_t porte, bool localhost_only=false, boost::function< bool(const boost::asio::ip::tcp::endpoint &)> accept_filter=0)
 Start the server on the specified TCP port. More...
 
virtual void StartServerUsingPortSharer ()
 Start the server using the TCP port sharer. More...
 
virtual bool IsPortSharerRunning ()
 Check if the port sharer is running. More...
 
virtual void StartServer (const std::vector< boost::asio::ip::tcp::endpoint > &listen_endpoints, boost::function< bool(const boost::asio::ip::tcp::endpoint &)> accept_filter=0)
 Start the server on the specified TCP endpoints. More...
 
virtual std::vector< boost::asio::ip::tcp::endpoint > GetListenEndpoints ()
 Get the TCP endpoints the server is listening on. More...
 
virtual std::vector< boost::asio::ip::tcp::endpoint > GetResolvedListenEndpoints ()
 Get the TCP endpoints the server is listening with "all" addresses resolved to specific addresses. More...
 
RR_OVIRTUAL std::vector< std::string > GetServerListenUrls () RR_OVERRIDE
 Get the TCP endpoints the server is listening on as Robot Raconteur candidate URLs. More...
 
void EnableNodeDiscoveryListening (uint32_t flags=(IPNodeDiscoveryFlags_LINK_LOCAL))
 Enable node discovery listening. More...
 
void DisableNodeDiscoveryListening ()
 Disable node discovery listening.
 
void EnableNodeAnnounce (uint32_t flags=(IPNodeDiscoveryFlags_LINK_LOCAL))
 Enable node discovery announce. More...
 
void DisableNodeAnnounce ()
 Disable node discovery announce.
 
int32_t GetNodeAnnouncePeriod ()
 Get the period between node announce. More...
 
void SetNodeAnnouncePeriod (int32_t millis)
 Set the period between node announce. More...
 
virtual int32_t GetDefaultHeartbeatPeriod ()
 Get the default heartbeat period. More...
 
virtual void SetDefaultHeartbeatPeriod (int32_t milliseconds)
 Set the default heartbeat period. More...
 
virtual int32_t GetMaxMessageSize ()
 Get the maximum serialized message size. More...
 
virtual void SetMaxMessageSize (int32_t size)
 Set the maximum serialized message size. More...
 
virtual int32_t GetMaxConnectionCount ()
 Get the maximum number of concurrent connections. More...
 
virtual void SetMaxConnectionCount (int32_t count)
 Set the maximum number of concurrent connections. More...
 
virtual bool GetRequireTls ()
 Get if all connections require TLS. More...
 
virtual void SetRequireTls (bool require_tls)
 Set if all connections require TLS. More...
 
virtual void LoadTlsNodeCertificate ()
 Load the TLS certificate from the system. More...
 
virtual bool IsTlsNodeCertificateLoaded ()
 Check if TLS certificate is loaded. More...
 
virtual bool IsTransportConnectionSecure (uint32_t endpoint)
 Check if specified endpoint is using TLS for its transport. More...
 
virtual bool IsTransportConnectionSecure (const boost::shared_ptr< Endpoint > &endpoint)
 Check if specified endpoint is using TLS for its transport. More...
 
virtual bool IsTransportConnectionSecure (const boost::shared_ptr< RRObject > &obj)
 Check if specified endpoint is using TLS for its transport. More...
 
virtual bool IsTransportConnectionSecure (const boost::shared_ptr< ITransportConnection > &transport)
 Check if specified endpoint is using TLS for its transport. More...
 
virtual bool IsSecurePeerIdentityVerified (uint32_t endpoint)
 Check if specified endpoint peer is using TLS and has been verified using a certificate. More...
 
virtual bool IsSecurePeerIdentityVerified (const boost::shared_ptr< Endpoint > &endpoint)
 Check if specified endpoint peer is using TLS and has been verified using a certificate. More...
 
virtual bool IsSecurePeerIdentityVerified (const boost::shared_ptr< RRObject > &obj)
 Check if specified endpoint peer is using TLS and has been verified using a certificate. More...
 
virtual bool IsSecurePeerIdentityVerified (const boost::shared_ptr< ITransportConnection > &transport)
 Check if specified endpoint peer is using TLS and has been verified using a certificate. More...
 
virtual std::string GetSecurePeerIdentity (uint32_t endpoint)
 Get the identity of the peer if secured using TLS. More...
 
virtual std::string GetSecurePeerIdentity (const boost::shared_ptr< Endpoint > &endpoint)
 Get the identity of the peer if secured using TLS. More...
 
virtual std::string GetSecurePeerIdentity (const boost::shared_ptr< RRObject > &obj)
 Get the identity of the peer if secured using TLS. More...
 
virtual std::string GetSecurePeerIdentity (const boost::shared_ptr< ITransportConnection > &transport)
 Get the identity of the peer if secured using TLS. More...
 
virtual bool GetAcceptWebSockets ()
 Get if the transport will accept incoming HTTP WebSocket connections. More...
 
virtual void SetAcceptWebSockets (bool value)
 Set if the transport will accept incoming HTTP websocket connections. More...
 
virtual std::vector< std::string > GetWebSocketAllowedOrigins ()
 Get the currently configured WebSocket origins. More...
 
virtual void AddWebSocketAllowedOrigin (boost::string_ref origin)
 Add a WebSocket allowed origin. More...
 
virtual void RemoveWebSocketAllowedOrigin (boost::string_ref origin)
 Remove a previously added WebSocket origin. More...
 
virtual bool GetDisableMessage4 ()
 Get disable Message Format Version 4. More...
 
virtual void SetDisableMessage4 (bool d)
 Set disable Message Format Version 4. More...
 
virtual bool GetDisableStringTable ()
 Get disable string table. More...
 
virtual void SetDisableStringTable (bool d)
 Set disable string table. More...
 
virtual bool GetDisableAsyncMessageIO ()
 Get if async message io is disabled. More...
 
virtual void SetDisableAsyncMessageIO (bool d)
 Set if async message io is disabled. More...
 

Detailed Description

Transport for Transport Control Protocol Internet Protocol (TCP/IP) networks.

It is recommended that ClientNodeSetup, ServerNodeSetup, or SecureServerNodeSetup be used to construct this class.

See robotraconteur_url for more information on URLs.

The TcpTransport implements transport connections over TCP/IP networks. TCP/IP is the most common protocol used for Internet and Local Area Network (LAN) communication, including Ethernet and WiFi connections. The Transport Control Protocol (TCP) is a reliable stream protocol that establishes connections between devices using IP address and port pairs. Each adapter has an assigned address, and applications create connections on different ports. TcpTransport listens to the port specified in StartServer(), and the client uses a URL containing the IP address and port of the listening transport. The TcpTransport uses the established connection to pass messages between nodes.

The IP protocol is available in two major versions, IPv4 and IPv6. The most common is IPv4, and its 32 bit address is typically written as four numbers, ie 172.17.12.174. IPv4 has a number of critical limitations, the greatest being its 2^32 address limit (approximately 4 billion). This is a problem when there are tens of billions of internet connected devices already present. IPv6 introduces a 128 bit address space, which allows for approximately 3.4×10^38 possible addresses. The major advantage for Robot Raconteur is the introduction of "link-local" addresses. These addresses begin with "FE80::" and finish with an "EUI-64" address, which is tied to the MAC address of the adaptor. IPv4 addresses need to be assigned to devices locally, and have a tendency to change. IPv6 addresses are permanently assigned to the adapter itself, meaning that network configuration for LAN communication is essentially automatic. Robot Raconteur will prefer IPv6 connections when possible for this reason.

The TcpTransport is capable of using "raw" streams that implement the Robot Raconteur message protocols, or to use HTTP WebSockets. HTTP WebSockets allow Robot Raconteur to communicate seamlessly with browsers and HTTP servers without requiring additional plugins. WebSockets provide additional security using "origins". See AddWebSocketAllowedOrigin() for more information.

The TcpTransport supports TLS encryption using certificates. See tls_security for more information on TLS. The TcpTransport supports four modes of TLS encryption:

Scheme Description Direction
rrs+tcp "Raw" protocol with TLS Both
rr+wss Websocket over HTTPS Client Only
rrs+ws Websocket with RobotRaconteur TLS over HTTP Both
rrs+wss Websocket with RobotRaconteur TLS over HTTPS Client Only

The different combinations of TLS and HTTPS for websockets are used for different scenarios. Robot Raconteur Core can initiate HTTPS connections, but cannot accept them. Accepting HTTPS connections requires a certificate issued by an authority like GoDaddy or Digicert, and is typically used with an HTTP server running RobotRaconteurWeb.

TLS certificates for Robot Raconteur nodes are issued by Wason Technology, LLC using a root certificate that is "burned in" to Robot Raconteur Core. All devices running Robot Raconteur will support this certificate chain.

Discovery for the TcpTransport is accomplished using User Defined Protocol (UDP) multicast and/or broadcast packets. Broadcast packets are sent to all connected devices, while multicast is sent to devices that have registered to receive them. Unlike TCP, the packets sent to broadcast or multicast are sent to the entire network. This allows for devices to find each other on the network.

For IPv4, the broadcast address 255.255.255.255 on port 48653 is used for discovery. By default, IPv4 is disabled in favor of IPv6. IPv6 uses the multicast following multicast addresses:

Address Scope Port Default?
FF01::BA86 Node-Local 48653 Disabled
FF02::BA86 Link-Local 48653 Enabled
FF05::BA86 Site-Local 48653 Disabled

By default, discovery will only occur on the link-local IPv6 scope. This will find nodes on the local subnet, but will not attempt to pass through any routers.

Constructor & Destructor Documentation

◆ TcpTransport()

RobotRaconteur::TcpTransport::TcpTransport ( const boost::shared_ptr< RobotRaconteurNode > &  node = RobotRaconteurNode::sp())

Construct a new TcpTransport.

Must use boost::make_shared<TcpTransport>()

The use of RobotRaconteurNodeSetup and subclasses is recommended to construct transports.

The transport must be registered with the node using RobotRaconteurNode::RegisterTransport() after construction.

Parameters
nodeThe node that will use the transport. Default is the singleton node

Member Function Documentation

◆ AddWebSocketAllowedOrigin()

virtual void RobotRaconteur::TcpTransport::AddWebSocketAllowedOrigin ( boost::string_ref  origin)
virtual

Add a WebSocket allowed origin.

WebSockets are vulnerable to an attack method called "cross-site scripting" (XSS). In XSS, a malicious website will attempt to create a connection to an arbitrary website or local device and attempt to hack or otherwise interact with it. WebSockets protect against this attack using an "Origin" HTTP header field specified in the header upon connection. This header field contains the domain name, the IP address, and/or the port of the web page that is attempting to initiate the connection. This header field is filled by the browser, and cannot be modified by the web page. If the web page is loaded from the local filesystem, the origin will be the empty string ("") or null ("null"). The Robot Raconteur Core library uses the empty string origin when initiating WebSocket connections. By default, it accepts the following origins:

  • (empty string)
  • "null"
  • "file://"
  • "http://robotraconteur.com"
  • "http://robotraconteur.com:80"
  • "http://(*).robotraconteur.com"
  • "http://(*).robotraconteur.com:80"
  • "https://robotraconteur.com"
  • "https://robotraconteur.com:443"
  • "https://(*).robotraconteur.com"
  • "https://(*).robotraconteur.com:443"

    Note: forward-slash-star is not a valid comment, assume (*) is *

The star symbol can be used for a subdomain wildcard when matching origins.

Additional allowed origins can be added using this function, or the --robotraconteur-tcp-ws-add-origin= command line option if the RobotRaconteurNodeSetup classes are being used.

Parameters
originThe origin to add

◆ EnableNodeAnnounce()

void RobotRaconteur::TcpTransport::EnableNodeAnnounce ( uint32_t  flags = (IPNodeDiscoveryFlags_LINK_LOCAL))

Enable node discovery announce.

By default enables announce on IPv6 link-local scope

Parameters
flagsThe flags specifying the scope

◆ EnableNodeDiscoveryListening()

void RobotRaconteur::TcpTransport::EnableNodeDiscoveryListening ( uint32_t  flags = (IPNodeDiscoveryFlags_LINK_LOCAL))

Enable node discovery listening.

By default enables listining on IPv6 link-local scope

Parameters
flagsThe flags specifying the scope

◆ GetAcceptWebSockets()

virtual bool RobotRaconteur::TcpTransport::GetAcceptWebSockets ( )
virtual

Get if the transport will accept incoming HTTP WebSocket connections.

Default: true

Returns
true The tranport will accept WebSocket connections
false The transport will reject WebSocket connections

◆ GetDefaultConnectTimeout()

virtual int32_t RobotRaconteur::TcpTransport::GetDefaultConnectTimeout ( )
virtual

Get the default connect timeout.

If the connection is not completed within the timeout, the connection attempt will be aborted.

Returns
int32_t The timeout in milliseconds

◆ GetDefaultHeartbeatPeriod()

virtual int32_t RobotRaconteur::TcpTransport::GetDefaultHeartbeatPeriod ( )
virtual

Get the default heartbeat period.

The heartbeat is used to keep the connection alive if no communication is occuring between nodes.

Default: 5 seconds

Returns
int32_t The period in milliseconds

◆ GetDefaultReceiveTimeout()

virtual int32_t RobotRaconteur::TcpTransport::GetDefaultReceiveTimeout ( )
virtual

Get the default receive timeout.

If no messages are received within the timeout, the connection is assumed to be lost.

Default: 15 seconds

Returns
int32_t The timeout in milliseconds

◆ GetDisableAsyncMessageIO()

virtual bool RobotRaconteur::TcpTransport::GetDisableAsyncMessageIO ( )
virtual

Get if async message io is disabled.

Async message io has better memory handling, at the expense of slightly higher latency.

Default: Async io enabled

Returns
true Async message io is disabled
false Async message io is not disabled

◆ GetDisableMessage4()

virtual bool RobotRaconteur::TcpTransport::GetDisableMessage4 ( )
virtual

Get disable Message Format Version 4.

Message Format Version 2 will be used

Default: Message V4 is enabled

Returns
true Disable Message V4
false Enable Message V4

◆ GetDisableStringTable()

virtual bool RobotRaconteur::TcpTransport::GetDisableStringTable ( )
virtual

Get disable string table.

Default: false

RobotRaconteurNodeSetup and its subclasses will disable the string table by default

Returns
true Disable the string table
false String table is not disabled

◆ GetListenEndpoints()

virtual std::vector<boost::asio::ip::tcp::endpoint> RobotRaconteur::TcpTransport::GetListenEndpoints ( )
virtual

Get the TCP endpoints the server is listening on.

Returns
std::vector<boost::asio::ip::tcp::endpoint>

◆ GetMaxConnectionCount()

virtual int32_t RobotRaconteur::TcpTransport::GetMaxConnectionCount ( )
virtual

Get the maximum number of concurrent connections.

Default: 0 for unlimited

Returns
int32_t The number of connections

◆ GetMaxMessageSize()

virtual int32_t RobotRaconteur::TcpTransport::GetMaxMessageSize ( )
virtual

Get the maximum serialized message size.

Default: 10 MB

Returns
int32_t The size in bytes

◆ GetNodeAnnouncePeriod()

int32_t RobotRaconteur::TcpTransport::GetNodeAnnouncePeriod ( )

Get the period between node announce.

Default 55 seconds

Returns
int32_t The period in milliseconds

◆ GetRequireTls()

virtual bool RobotRaconteur::TcpTransport::GetRequireTls ( )
virtual

Get if all connections require TLS.

Returns
true All connections require TLS
false Unencrypted connections allowed

◆ GetResolvedListenEndpoints()

virtual std::vector<boost::asio::ip::tcp::endpoint> RobotRaconteur::TcpTransport::GetResolvedListenEndpoints ( )
virtual

Get the TCP endpoints the server is listening with "all" addresses resolved to specific addresses.

Returns
std::vector<boost::asio::ip::tcp::endpoint>

◆ GetSecurePeerIdentity() [1/4]

virtual std::string RobotRaconteur::TcpTransport::GetSecurePeerIdentity ( const boost::shared_ptr< Endpoint > &  endpoint)
virtual

Get the identity of the peer if secured using TLS.

Get the identity of a peer verified using TLS certificates. Returns a NodeID in string format. Will throw AuthenticationException if the peer has not been verified.

Parameters
endpointThe endpoint to check
Returns
std::string The verified peer NodeID as a string

◆ GetSecurePeerIdentity() [2/4]

virtual std::string RobotRaconteur::TcpTransport::GetSecurePeerIdentity ( const boost::shared_ptr< ITransportConnection > &  transport)
virtual

Get the identity of the peer if secured using TLS.

Get the identity of a peer verified using TLS certificates. Returns a NodeID in string format. Will throw AuthenticationException if the peer has not been verified.

Parameters
endpointThe endpoint to check
Returns
std::string The verified peer NodeID as a string

◆ GetSecurePeerIdentity() [3/4]

virtual std::string RobotRaconteur::TcpTransport::GetSecurePeerIdentity ( const boost::shared_ptr< RRObject > &  obj)
virtual

Get the identity of the peer if secured using TLS.

Get the identity of a peer verified using TLS certificates. Returns a NodeID in string format. Will throw AuthenticationException if the peer has not been verified.

Parameters
endpointThe endpoint to check
Returns
std::string The verified peer NodeID as a string

◆ GetSecurePeerIdentity() [4/4]

virtual std::string RobotRaconteur::TcpTransport::GetSecurePeerIdentity ( uint32_t  endpoint)
virtual

Get the identity of the peer if secured using TLS.

Get the identity of a peer verified using TLS certificates. Returns a NodeID in string format. Will throw AuthenticationException if the peer has not been verified.

Parameters
endpointThe endpoint to check
Returns
std::string The verified peer NodeID as a string

◆ GetServerListenUrls()

RR_OVIRTUAL std::vector<std::string> RobotRaconteur::TcpTransport::GetServerListenUrls ( )
virtual

Get the TCP endpoints the server is listening on as Robot Raconteur candidate URLs.

Returns
std::vector<std::string> Candidate connections urls for the node, without service specified

Implements RobotRaconteur::Transport.

◆ GetWebSocketAllowedOrigins()

virtual std::vector<std::string> RobotRaconteur::TcpTransport::GetWebSocketAllowedOrigins ( )
virtual

Get the currently configured WebSocket origins.

See AddWebSocketAllowedOrigin()

Returns
std::vector<std::string> The currently configured WebSocket origins

◆ IsPortSharerRunning()

virtual bool RobotRaconteur::TcpTransport::IsPortSharerRunning ( )
virtual

Check if the port sharer is running.

Returns
true The port sharer is running and connected
false The port sharer is not running or is not connected

◆ IsSecurePeerIdentityVerified() [1/4]

virtual bool RobotRaconteur::TcpTransport::IsSecurePeerIdentityVerified ( const boost::shared_ptr< Endpoint > &  endpoint)
virtual

Check if specified endpoint peer is using TLS and has been verified using a certificate.

Checks if the peer server node has a valid certificate, or if the peer client has been verified using mutual authentication.

Throws ConnectionException if the endpoint is invalid or the connection is not using TcpTransport

Parameters
endpointThe endpoint to check
Returns
true The peer node has been verified with a certificate
false The peer node has not been verified

◆ IsSecurePeerIdentityVerified() [2/4]

virtual bool RobotRaconteur::TcpTransport::IsSecurePeerIdentityVerified ( const boost::shared_ptr< ITransportConnection > &  transport)
virtual

Check if specified endpoint peer is using TLS and has been verified using a certificate.

Checks if the peer server node has a valid certificate, or if the peer client has been verified using mutual authentication.

Throws ConnectionException if the endpoint is invalid or the connection is not using TcpTransport

Parameters
endpointThe endpoint to check
Returns
true The peer node has been verified with a certificate
false The peer node has not been verified

◆ IsSecurePeerIdentityVerified() [3/4]

virtual bool RobotRaconteur::TcpTransport::IsSecurePeerIdentityVerified ( const boost::shared_ptr< RRObject > &  obj)
virtual

Check if specified endpoint peer is using TLS and has been verified using a certificate.

Checks if the peer server node has a valid certificate, or if the peer client has been verified using mutual authentication.

Throws ConnectionException if the endpoint is invalid or the connection is not using TcpTransport

Parameters
endpointThe endpoint to check
Returns
true The peer node has been verified with a certificate
false The peer node has not been verified

◆ IsSecurePeerIdentityVerified() [4/4]

virtual bool RobotRaconteur::TcpTransport::IsSecurePeerIdentityVerified ( uint32_t  endpoint)
virtual

Check if specified endpoint peer is using TLS and has been verified using a certificate.

Checks if the peer server node has a valid certificate, or if the peer client has been verified using mutual authentication.

Throws ConnectionException if the endpoint is invalid or the connection is not using TcpTransport

Parameters
endpointThe endpoint to check
Returns
true The peer node has been verified with a certificate
false The peer node has not been verified

◆ IsTlsNodeCertificateLoaded()

virtual bool RobotRaconteur::TcpTransport::IsTlsNodeCertificateLoaded ( )
virtual

Check if TLS certificate is loaded.

Returns
true The TLS certificate has been loaded
false No TLS certificate is loaded

◆ IsTransportConnectionSecure() [1/4]

virtual bool RobotRaconteur::TcpTransport::IsTransportConnectionSecure ( const boost::shared_ptr< Endpoint > &  endpoint)
virtual

Check if specified endpoint is using TLS for its transport.

Throws ConnectionException if the endpoint is invalid or the connection is not using TcpTransport

Parameters
endpointThe endpoint to check
Returns
true The connection is using TLS
false The connection is not using TLS

◆ IsTransportConnectionSecure() [2/4]

virtual bool RobotRaconteur::TcpTransport::IsTransportConnectionSecure ( const boost::shared_ptr< ITransportConnection > &  transport)
virtual

Check if specified endpoint is using TLS for its transport.

Throws ConnectionException if the endpoint is invalid or the connection is not using TcpTransport

Parameters
endpointThe endpoint to check
Returns
true The connection is using TLS
false The connection is not using TLS

◆ IsTransportConnectionSecure() [3/4]

virtual bool RobotRaconteur::TcpTransport::IsTransportConnectionSecure ( const boost::shared_ptr< RRObject > &  obj)
virtual

Check if specified endpoint is using TLS for its transport.

Throws ConnectionException if the endpoint is invalid or the connection is not using TcpTransport

Parameters
endpointThe endpoint to check
Returns
true The connection is using TLS
false The connection is not using TLS

◆ IsTransportConnectionSecure() [4/4]

virtual bool RobotRaconteur::TcpTransport::IsTransportConnectionSecure ( uint32_t  endpoint)
virtual

Check if specified endpoint is using TLS for its transport.

Throws ConnectionException if the endpoint is invalid or the connection is not using TcpTransport

Parameters
endpointThe endpoint to check
Returns
true The connection is using TLS
false The connection is not using TLS

◆ LoadTlsNodeCertificate()

virtual void RobotRaconteur::TcpTransport::LoadTlsNodeCertificate ( )
virtual

Load the TLS certificate from the system.

The TLS certificate is stored on the filesystem. See tls_security for more information on storage location.

◆ RemoveWebSocketAllowedOrigin()

virtual void RobotRaconteur::TcpTransport::RemoveWebSocketAllowedOrigin ( boost::string_ref  origin)
virtual

Remove a previously added WebSocket origin.

See AddWebSocketAllowedOrigin()

Parameters
originThe origin to remove

◆ SetAcceptWebSockets()

virtual void RobotRaconteur::TcpTransport::SetAcceptWebSockets ( bool  value)
virtual

Set if the transport will accept incoming HTTP websocket connections.

Default: true

Parameters
valueIf true, the transport will accept incoming WebSocket connections

◆ SetDefaultConnectTimeout()

virtual void RobotRaconteur::TcpTransport::SetDefaultConnectTimeout ( int32_t  milliseconds)
virtual

Set the default connect timeout.

If the connection is not completed within the timeout, the connection attempt will be aborted.

Default: 5 seconds

Parameters
millisecondsThe timeout in milliseconds

◆ SetDefaultHeartbeatPeriod()

virtual void RobotRaconteur::TcpTransport::SetDefaultHeartbeatPeriod ( int32_t  milliseconds)
virtual

Set the default heartbeat period.

The heartbeat is used to keep the connection alive if no communication is occuring between nodes.

Default: 5 seconds

Parameters
millisecondsThe heartbeat in milliseconds

◆ SetDefaultReceiveTimeout()

virtual void RobotRaconteur::TcpTransport::SetDefaultReceiveTimeout ( int32_t  milliseconds)
virtual

Set the default receive timeout.

If no messages are received within the timeout, the connection is assumed to be lost.

Default: 15 seconds

Parameters
millisecondsThe timeout in milliseconds

◆ SetDisableAsyncMessageIO()

virtual void RobotRaconteur::TcpTransport::SetDisableAsyncMessageIO ( bool  d)
virtual

Set if async message io is disabled.

Async message io has better memory handling, at the expense of slightly higher latency.

Default: Async io enabled

Parameters
dIf true, async io is disabled

◆ SetDisableMessage4()

virtual void RobotRaconteur::TcpTransport::SetDisableMessage4 ( bool  d)
virtual

Set disable Message Format Version 4.

Message Format Version 2 will be used

Default: Message V4 is enabled

Parameters
dIf true, Message V4 is disabled

◆ SetDisableStringTable()

virtual void RobotRaconteur::TcpTransport::SetDisableStringTable ( bool  d)
virtual

Set disable string table.

Default: false

RobotRaconteurNodeSetup and its subclasses will disable the string table by default

Parameters
dIf true, string table is disabled

◆ SetMaxConnectionCount()

virtual void RobotRaconteur::TcpTransport::SetMaxConnectionCount ( int32_t  count)
virtual

Set the maximum number of concurrent connections.

Default: 0 for unlimited

Parameters
countThe number of connections

◆ SetMaxMessageSize()

virtual void RobotRaconteur::TcpTransport::SetMaxMessageSize ( int32_t  size)
virtual

Set the maximum serialized message size.

Default: 10 MB

Parameters
sizeThe size in bytes

◆ SetNodeAnnouncePeriod()

void RobotRaconteur::TcpTransport::SetNodeAnnouncePeriod ( int32_t  millis)

Set the period between node announce.

Default 55 seconds

Parameters
millisThe period in milliseconds

◆ SetRequireTls()

virtual void RobotRaconteur::TcpTransport::SetRequireTls ( bool  require_tls)
virtual

Set if all connections require TLS.

Parameters
require_tlsIf true, all connections require TLS

◆ StartServer() [1/2]

virtual void RobotRaconteur::TcpTransport::StartServer ( const std::vector< boost::asio::ip::tcp::endpoint > &  listen_endpoints,
boost::function< bool(const boost::asio::ip::tcp::endpoint &)>  accept_filter = 0 
)
virtual

Start the server on the specified TCP endpoints.

The official Robot Raconteur port 48653 is reserved for the port sharer

Parameters
listen_endpointsThe endpoints to listen on. May be IPv4 or IPv6
accept_filterAn optional function that returns true if the endpoint should be accepted

◆ StartServer() [2/2]

virtual void RobotRaconteur::TcpTransport::StartServer ( int32_t  porte,
bool  localhost_only = false,
boost::function< bool(const boost::asio::ip::tcp::endpoint &)>  accept_filter = 0 
)
virtual

Start the server on the specified TCP port.

The official Robot Raconteur port 48653 is reserved for the port sharer

Parameters
porteThe port to listen on
localhost_onlytrue to only listen on localhost
accept_filterAn optional function that returns true if the endpoint should be accepted

◆ StartServerUsingPortSharer()

virtual void RobotRaconteur::TcpTransport::StartServerUsingPortSharer ( )
virtual

Start the server using the TCP port sharer.

The TCP port sharer is a utility program that accepts incoming connections on the official Robot Raconteur port 48653 and forwards to nodes based on the NodeID and/or NodeName requested by the client


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