#include <protocol_switcher.h>
Definition at line 69 of file protocol_switcher.h.
◆ config_type
◆ protocol_switcher()
Definition at line 88 of file protocol_switcher.h.
88 :m_http_handler(psnd_hndlr,
config.m_http_config, conn_context), m_levin_handler(psnd_hndlr,
config.m_levin_config, conn_context), pcurrent_handler(NULL)
◆ ~protocol_switcher()
| virtual epee::net_utils::protocol_switcher::~protocol_switcher |
( |
| ) |
|
|
inlinevirtual |
◆ after_init_connection()
| bool epee::net_utils::protocol_switcher::after_init_connection |
( |
| ) |
|
|
inline |
◆ handle_recv()
| bool epee::net_utils::protocol_switcher::handle_recv |
( |
const void * |
ptr, |
|
|
size_t |
cb |
|
) |
| |
|
virtual |
Definition at line 91 of file protocol_switcher.h.
97 m_cached_buff.append((
const char*)ptr, cb);
98 if(m_cached_buff.size() <
sizeof(
uint64_t))
103 pcurrent_handler = &m_levin_handler;
104 return pcurrent_handler->
handle_recv(m_cached_buff.data(), m_cached_buff.size());
106 if(m_cached_buff.substr(0, 4) ==
"GET " || m_cached_buff.substr(0, 4) ==
"POST")
108 pcurrent_handler = &m_http_handler;
109 return pcurrent_handler->
handle_recv(m_cached_buff.data(), m_cached_buff.size());
112 LOG_ERROR(
"Wrong protocol accepted on port...");
virtual bool handle_recv(const void *ptr, size_t cb)=0
unsigned __int64 uint64_t
The documentation for this class was generated from the following file: