mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 14:35:52 +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
|
#endif
|
||||||
|
|
||||||
void Application::run()
|
void Application::setup()
|
||||||
{
|
{
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#ifdef SIGINT
|
#ifdef SIGINT
|
||||||
@@ -256,7 +256,10 @@ void Application::run()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
mNetOps.setStateTimer();
|
mNetOps.setStateTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Application::run()
|
||||||
|
{
|
||||||
mIOService.run(); // This blocks
|
mIOService.run(); // This blocks
|
||||||
|
|
||||||
if (mWSPublicDoor)
|
if (mWSPublicDoor)
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ public:
|
|||||||
uint256 getNonce256() { return mNonce256; }
|
uint256 getNonce256() { return mNonce256; }
|
||||||
std::size_t getNonceST() { return mNonceST; }
|
std::size_t getNonceST() { return mNonceST; }
|
||||||
|
|
||||||
|
void setup();
|
||||||
void run();
|
void run();
|
||||||
void stop();
|
void stop();
|
||||||
void sweep();
|
void sweep();
|
||||||
|
|||||||
@@ -17,9 +17,14 @@ extern bool AddSystemEntropy();
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace boost::unit_test;
|
using namespace boost::unit_test;
|
||||||
|
|
||||||
void startServer()
|
void setupServer()
|
||||||
{
|
{
|
||||||
theApp = new Application();
|
theApp = new Application();
|
||||||
|
theApp->setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void startServer()
|
||||||
|
{
|
||||||
theApp->run(); // Blocks till we get a stop RPC.
|
theApp->run(); // Blocks till we get a stop RPC.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,6 +199,7 @@ int main(int argc, char* argv[])
|
|||||||
else if (!vm.count("parameters"))
|
else if (!vm.count("parameters"))
|
||||||
{
|
{
|
||||||
// No arguments. Run server.
|
// No arguments. Run server.
|
||||||
|
setupServer();
|
||||||
startServer();
|
startServer();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user