summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/NetworkSingleton.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-06-17 16:38:00 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-08-20 17:15:23 +0200
commit4315a113935902bbbb82047e3f43695b4d76fff2 (patch)
treed57b5ebb021faa3f52b5cbf78d9a275d1ae7be1a /src/OSSupport/NetworkSingleton.h
parentMerge pull request #2391 from SamJBarney/CropGrowthFix (diff)
downloadcuberite-4315a113935902bbbb82047e3f43695b4d76fff2.tar
cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.tar.gz
cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.tar.bz2
cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.tar.lz
cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.tar.xz
cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.tar.zst
cuberite-4315a113935902bbbb82047e3f43695b4d76fff2.zip
Diffstat (limited to '')
-rw-r--r--src/OSSupport/NetworkSingleton.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/OSSupport/NetworkSingleton.h b/src/OSSupport/NetworkSingleton.h
index 0536a1c82..c72df38ec 100644
--- a/src/OSSupport/NetworkSingleton.h
+++ b/src/OSSupport/NetworkSingleton.h
@@ -44,13 +44,18 @@ typedef std::vector<cIPLookupPtr> cIPLookupPtrs;
class cNetworkSingleton
{
public:
+ cNetworkSingleton();
~cNetworkSingleton();
/** Returns the singleton instance of this class */
static cNetworkSingleton & Get(void);
+ /** Initialises all network-related threads.
+ To be called on first run or after app restart. */
+ void Initialise(void);
+
/** Terminates all network-related threads.
- To be used only on app shutdown.
+ To be used only on app shutdown or restart.
MSVC runtime requires that the LibEvent networking be shut down before the main() function is exitted; this is the way to do it. */
void Terminate(void);
@@ -122,10 +127,6 @@ protected:
/** The thread in which the main LibEvent loop runs. */
std::thread m_EventLoopThread;
-
- /** Initializes the LibEvent internals. */
- cNetworkSingleton(void);
-
/** Converts LibEvent-generated log events into log messages in MCS log. */
static void LogCallback(int a_Severity, const char * a_Msg);