mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-30 07:55:51 +00:00
Fix CI unit tests (#5196)
- Add retries for rpc client - Add dynamic port allocation for rpc servers
This commit is contained in:
@@ -22,18 +22,21 @@
|
||||
|
||||
#include <xrpl/basics/chrono.h>
|
||||
#include <xrpl/beast/core/List.h>
|
||||
#include <xrpl/server/Server.h>
|
||||
#include <xrpl/server/detail/Door.h>
|
||||
#include <xrpl/server/detail/io_list.h>
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
using Endpoints = std::vector<boost::asio::ip::tcp::endpoint>;
|
||||
using Endpoints =
|
||||
std::unordered_map<std::string, boost::asio::ip::tcp::endpoint>;
|
||||
|
||||
/** A multi-protocol server.
|
||||
|
||||
@@ -168,11 +171,17 @@ ServerImpl<Handler>::ports(std::vector<Port> const& ports)
|
||||
for (auto const& port : ports)
|
||||
{
|
||||
ports_.push_back(port);
|
||||
auto& internalPort = ports_.back();
|
||||
if (auto sp = ios_.emplace<Door<Handler>>(
|
||||
handler_, io_service_, ports_.back(), j_))
|
||||
handler_, io_service_, internalPort, j_))
|
||||
{
|
||||
list_.push_back(sp);
|
||||
eps.push_back(sp->get_endpoint());
|
||||
|
||||
auto ep = sp->get_endpoint();
|
||||
if (!internalPort.port)
|
||||
internalPort.port = ep.port();
|
||||
eps.emplace(port.name, std::move(ep));
|
||||
|
||||
sp->run();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user