mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Added read message max size in socket communication (#42)
* Added peermaxmsg size to config * Completed inital implementation * Completed adding message max size * Refactored code * Refactored code to have data types using std library * Added peer maxmpm * Added const to session_options
This commit is contained in:
@@ -53,6 +53,11 @@ net::io_context ioc;
|
||||
*/
|
||||
std::thread listener_thread;
|
||||
|
||||
/**
|
||||
* Used to pass down the default settings to the socket session
|
||||
*/
|
||||
sock::session_options sess_opts;
|
||||
|
||||
// Challenge response fields.
|
||||
// These fields are used on challenge response validation.
|
||||
static const char *CHALLENGE_RESP_TYPE = "type";
|
||||
@@ -251,13 +256,17 @@ int remove_user(const std::string &sessionid)
|
||||
*/
|
||||
void start_listening()
|
||||
{
|
||||
|
||||
auto address = net::ip::make_address(conf::cfg.listenip);
|
||||
sess_opts.max_message_size = conf::cfg.pubmaxsize;
|
||||
|
||||
|
||||
std::make_shared<sock::socket_server<user_outbound_message>>(
|
||||
ioc,
|
||||
ctx,
|
||||
tcp::endpoint{address, conf::cfg.pubport},
|
||||
global_usr_session_handler)
|
||||
global_usr_session_handler,
|
||||
sess_opts)
|
||||
->run();
|
||||
|
||||
listener_thread = std::thread([&] { ioc.run(); });
|
||||
|
||||
Reference in New Issue
Block a user