CCF
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
asynchost::TCPImpl Class Reference

#include <tcp.h>

Inherits asynchost::with_uv_handle< uv_tcp_t >.

Public Member Functions

void set_behaviour (std::unique_ptr< SocketBehaviour< TCP > > b)
 
std::string get_host () const
 
std::string get_port () const
 
std::string get_peer_name () const
 
std::optional< std::string > get_listen_name () const
 
void client_bind ()
 
void on_client_resolved (uv_getaddrinfo_t *req, int rc)
 
void start (int64_t id)
 This is to mimic UDP's implementation. TCP's start is on_accept.
 
bool connect (const std::string &host_, const std::string &port_, const std::optional< std::string > &client_host_=std::nullopt)
 
bool reconnect ()
 
bool listen (const std::string &host_, const std::string &port_, const std::optional< std::string > &name=std::nullopt)
 
bool write (size_t len, const uint8_t *data, sockaddr addr={})
 

Static Public Member Functions

static void reset_read_quota ()
 
static void on_client_resolved (uv_getaddrinfo_t *req, int rc, struct addrinfo *)
 

Friends

class close_ptr< TCPImpl >
 

Additional Inherited Members

- Protected Member Functions inherited from asynchost::with_uv_handle< uv_tcp_t >
 with_uv_handle ()
 
 with_uv_handle (const with_uv_handle< uv_tcp_t > &that)=delete
 
 with_uv_handle (with_uv_handle< uv_tcp_t > &&that)=delete
 
virtual ~with_uv_handle ()=default
 
void close ()
 
- Protected Attributes inherited from asynchost::with_uv_handle< uv_tcp_t >
uv_tcp_t uv_handle
 

Member Function Documentation

◆ client_bind()

void asynchost::TCPImpl::client_bind ( )
inline

◆ connect()

bool asynchost::TCPImpl::connect ( const std::string &  host_,
const std::string &  port_,
const std::optional< std::string > &  client_host_ = std::nullopt 
)
inline

◆ get_host()

std::string asynchost::TCPImpl::get_host ( ) const
inline

◆ get_listen_name()

std::optional< std::string > asynchost::TCPImpl::get_listen_name ( ) const
inline

◆ get_peer_name()

std::string asynchost::TCPImpl::get_peer_name ( ) const
inline

◆ get_port()

std::string asynchost::TCPImpl::get_port ( ) const
inline

◆ listen()

bool asynchost::TCPImpl::listen ( const std::string &  host_,
const std::string &  port_,
const std::optional< std::string > &  name = std::nullopt 
)
inline

◆ on_client_resolved() [1/2]

void asynchost::TCPImpl::on_client_resolved ( uv_getaddrinfo_t *  req,
int  rc 
)
inline

◆ on_client_resolved() [2/2]

static void asynchost::TCPImpl::on_client_resolved ( uv_getaddrinfo_t *  req,
int  rc,
struct addrinfo *   
)
inlinestatic

◆ reconnect()

bool asynchost::TCPImpl::reconnect ( )
inline

◆ reset_read_quota()

static void asynchost::TCPImpl::reset_read_quota ( )
inlinestatic

◆ set_behaviour()

void asynchost::TCPImpl::set_behaviour ( std::unique_ptr< SocketBehaviour< TCP > >  b)
inline

◆ start()

void asynchost::TCPImpl::start ( int64_t  id)
inline

This is to mimic UDP's implementation. TCP's start is on_accept.

◆ write()

bool asynchost::TCPImpl::write ( size_t  len,
const uint8_t *  data,
sockaddr  addr = {} 
)
inline

Friends And Related Symbol Documentation

◆ close_ptr< TCPImpl >

friend class close_ptr< TCPImpl >
friend

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