Restart the RPC connection acceptor in the face of errors (#1390)

This commit is contained in:
Roy Keene 2018-11-19 16:18:35 -06:00 committed by GitHub
commit 2406cdc837
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -155,9 +155,10 @@ void rai::rpc::accept ()
{
auto connection (std::make_shared<rai::rpc_connection> (node, *this));
acceptor.async_accept (connection->socket, [this, connection](boost::system::error_code const & ec) {
accept ();
if (!ec)
{
accept ();
connection->parse_connection ();
}
else

View file

@ -97,9 +97,10 @@ void rai::rpc_secure::accept ()
{
auto connection (std::make_shared<rai::rpc_connection_secure> (node, *this));
acceptor.async_accept (connection->socket, [this, connection](boost::system::error_code const & ec) {
accept ();
if (!ec)
{
accept ();
connection->parse_connection ();
}
else