Skip to content

Commit

Permalink
#1774 change hwm limits for zmq broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Mar 13, 2024
1 parent d05e981 commit 3d5cefc
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions libskale/broadcaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,8 @@ void* ZmqBroadcaster::server_socket() const {
val = 60000;
zmq_setsockopt( m_zmq_server_socket, ZMQ_HEARTBEAT_TTL, &val, sizeof( val ) );


val = 16;
zmq_setsockopt( m_zmq_server_socket, ZMQ_RCVHWM, &val, sizeof( val ) );
val = 16;
// remove limits to prevent txns from being dropped out
val = 0;
zmq_setsockopt( m_zmq_server_socket, ZMQ_SNDHWM, &val, sizeof( val ) );


Expand Down Expand Up @@ -136,9 +134,6 @@ void* ZmqBroadcaster::client_socket() const {

value = 16;
zmq_setsockopt( m_zmq_client_socket, ZMQ_RCVHWM, &value, sizeof( value ) );
value = 16;
zmq_setsockopt( m_zmq_client_socket, ZMQ_SNDHWM, &value, sizeof( value ) );


const dev::eth::ChainParams& ch = m_client.chainParams();

Expand Down Expand Up @@ -254,6 +249,8 @@ void ZmqBroadcaster::broadcast( const std::string& _rlp ) {

int res = zmq_send( server_socket(), const_cast< char* >( _rlp.c_str() ), _rlp.size(), 0 );
if ( res <= 0 ) {
clog( dev::VerbosityWarning, "zmq-broadcaster" )
<< "Got error " << res << " in zmq_send: " << zmq_strerror( res );
throw std::runtime_error( "Zmq can't send data" );
}
}

0 comments on commit 3d5cefc

Please sign in to comment.