mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-02 17:06:00 +00:00
Make it easier to insert code between when the server is setup and when it's started.
This commit is contained in:
@@ -81,7 +81,7 @@ void sigIntHandler(int)
|
||||
}
|
||||
#endif
|
||||
|
||||
void Application::run()
|
||||
void Application::setup()
|
||||
{
|
||||
#ifndef WIN32
|
||||
#ifdef SIGINT
|
||||
@@ -256,7 +256,10 @@ void Application::run()
|
||||
}
|
||||
else
|
||||
mNetOps.setStateTimer();
|
||||
}
|
||||
|
||||
void Application::run()
|
||||
{
|
||||
mIOService.run(); // This blocks
|
||||
|
||||
if (mWSPublicDoor)
|
||||
|
||||
@@ -133,6 +133,7 @@ public:
|
||||
uint256 getNonce256() { return mNonce256; }
|
||||
std::size_t getNonceST() { return mNonceST; }
|
||||
|
||||
void setup();
|
||||
void run();
|
||||
void stop();
|
||||
void sweep();
|
||||
|
||||
@@ -17,9 +17,14 @@ extern bool AddSystemEntropy();
|
||||
using namespace std;
|
||||
using namespace boost::unit_test;
|
||||
|
||||
void startServer()
|
||||
void setupServer()
|
||||
{
|
||||
theApp = new Application();
|
||||
theApp->setup();
|
||||
}
|
||||
|
||||
void startServer()
|
||||
{
|
||||
theApp->run(); // Blocks till we get a stop RPC.
|
||||
}
|
||||
|
||||
@@ -194,6 +199,7 @@ int main(int argc, char* argv[])
|
||||
else if (!vm.count("parameters"))
|
||||
{
|
||||
// No arguments. Run server.
|
||||
setupServer();
|
||||
startServer();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user