From 33a30238f6545b6938a341166f15b56894a84722 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Thu, 27 Feb 2025 08:11:53 -0600 Subject: [PATCH] Add 1MB send/receive buffer for P2P --- plugins/net_plugin/net_plugin.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index 827bd38045..8ef39be1b1 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -1376,11 +1376,12 @@ namespace eosio { verify_strand_in_this_thread( strand, __func__, __LINE__ ); update_endpoints(); - boost::asio::ip::tcp::no_delay nodelay( true ); boost::system::error_code ec; - socket->set_option( nodelay, ec ); + socket->set_option( boost::asio::ip::tcp::no_delay{true}, ec ); + if (!ec) socket->set_option(boost::asio::socket_base::send_buffer_size{1024*1024}, ec); + if (!ec) socket->set_option(boost::asio::socket_base::receive_buffer_size{1024*1024}, ec); if( ec ) { - peer_wlog( this, "connection failed (set_option): ${e1}", ( "e1", ec.message() ) ); + peer_wlog( this, "connection failed (set_option): ${e}", ( "e", ec.message() ) ); close(); return false; } else {