Skip to content

Commit 33a3023

Browse files
committed
Add 1MB send/receive buffer for P2P
1 parent cac0079 commit 33a3023

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugins/net_plugin/net_plugin.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -1376,11 +1376,12 @@ namespace eosio {
13761376
verify_strand_in_this_thread( strand, __func__, __LINE__ );
13771377

13781378
update_endpoints();
1379-
boost::asio::ip::tcp::no_delay nodelay( true );
13801379
boost::system::error_code ec;
1381-
socket->set_option( nodelay, ec );
1380+
socket->set_option( boost::asio::ip::tcp::no_delay{true}, ec );
1381+
if (!ec) socket->set_option(boost::asio::socket_base::send_buffer_size{1024*1024}, ec);
1382+
if (!ec) socket->set_option(boost::asio::socket_base::receive_buffer_size{1024*1024}, ec);
13821383
if( ec ) {
1383-
peer_wlog( this, "connection failed (set_option): ${e1}", ( "e1", ec.message() ) );
1384+
peer_wlog( this, "connection failed (set_option): ${e}", ( "e", ec.message() ) );
13841385
close();
13851386
return false;
13861387
} else {

0 commit comments

Comments
 (0)