Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
tcp_echo_server Struct Reference

#include <tcp_echo_server.hpp>

Public Member Functions

 tcp_echo_server (asio::io_service &service, short port)
 
void start_accept ()
 
void handle_accept (tcp_echo_session::ptr new_session, const asio::error_code &ec)
 

Public Attributes

asio::io_service & m_service
 
asio::ip::tcp::acceptor m_acceptor
 

Detailed Description

Definition at line 74 of file tcp_echo_server.hpp.

Constructor & Destructor Documentation

◆ tcp_echo_server()

tcp_echo_server::tcp_echo_server ( asio::io_service & service,
short port )
inline

Definition at line 75 of file tcp_echo_server.hpp.

76 : m_service(service)
77 , m_acceptor(service, asio::ip::tcp::endpoint(asio::ip::tcp::v6(), port))
78 {
79 this->start_accept();
80 }
asio::ip::tcp::acceptor m_acceptor
asio::io_service & m_service
Here is the call graph for this function:

Member Function Documentation

◆ handle_accept()

void tcp_echo_server::handle_accept ( tcp_echo_session::ptr new_session,
const asio::error_code & ec )
inline

Definition at line 88 of file tcp_echo_server.hpp.

88 {
89 if (!ec) {
90 new_session->start();
91 }
93 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ start_accept()

void tcp_echo_server::start_accept ( )
inline

Definition at line 82 of file tcp_echo_server.hpp.

82 {
84 m_acceptor.async_accept(new_session->m_socket,
85 bind(&tcp_echo_server::handle_accept, this, new_session, _1));
86 }
void handle_accept(tcp_echo_session::ptr new_session, const asio::error_code &ec)
websocketpp::lib::shared_ptr< tcp_echo_session > ptr
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_acceptor

asio::ip::tcp::acceptor tcp_echo_server::m_acceptor

Definition at line 96 of file tcp_echo_server.hpp.

◆ m_service

asio::io_service& tcp_echo_server::m_service

Definition at line 95 of file tcp_echo_server.hpp.


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