Class astutedds::rtps::TCPServer

ClassList > astutedds > rtps > TCPServer

TCP server listening for incoming connections.

  • #include <tcp_transport.hpp>

Public Functions

Type Name
TCPServer ()
TCPServer (const TCPServer &) = delete
void accept_pending ()
Accept pending connections (non-blocking)
bool is_listening () const
Check if listening.
bool listen (uint16_t port, int backlog=16)
Start listening on port.
TCPServer & operator= (const TCPServer &) = delete
uint16_t port () const
Get listening port.
void set_accept_callback (TCPAcceptCallback callback)
Set callback for new connections.
platform::socket_t socket_fd () const
Get socket file descriptor.
void stop ()
Stop listening and close all connections.
~TCPServer ()

Public Functions Documentation

function TCPServer [1/2]

astutedds::rtps::TCPServer::TCPServer () 

function TCPServer [2/2]

astutedds::rtps::TCPServer::TCPServer (
    const TCPServer &
) = delete

function accept_pending

Accept pending connections (non-blocking)

void astutedds::rtps::TCPServer::accept_pending () 


function is_listening

Check if listening.

inline bool astutedds::rtps::TCPServer::is_listening () const


function listen

Start listening on port.

bool astutedds::rtps::TCPServer::listen (
    uint16_t port,
    int backlog=16
) 

Parameters:

  • port Port to listen on (0 for ephemeral)
  • backlog Listen backlog

Returns:

true if listening


function operator=

TCPServer & astutedds::rtps::TCPServer::operator= (
    const TCPServer &
) = delete

function port

Get listening port.

inline uint16_t astutedds::rtps::TCPServer::port () const


function set_accept_callback

Set callback for new connections.

void astutedds::rtps::TCPServer::set_accept_callback (
    TCPAcceptCallback callback
) 


function socket_fd

Get socket file descriptor.

inline platform::socket_t astutedds::rtps::TCPServer::socket_fd () const


function stop

Stop listening and close all connections.

void astutedds::rtps::TCPServer::stop () 


function ~TCPServer

astutedds::rtps::TCPServer::~TCPServer () 


The documentation for this class was generated from the following file include/astutedds/rtps/tcp_transport.hpp