diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-08-22 14:07:34 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-08-22 14:07:34 +0200 |
commit | f52a769761d56f72b9886080c873eb6f4d28acb7 (patch) | |
tree | a176dfd7d4418da5896cb73e9625ebe16e2c84e7 /src/OSSupport/NetworkSingleton.h | |
parent | Merge pull request #2443 from mjhanninen/fix-osx-build-due-warnings (diff) | |
parent | Fixed and improved restarting (diff) | |
download | cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.tar cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.tar.gz cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.tar.bz2 cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.tar.lz cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.tar.xz cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.tar.zst cuberite-f52a769761d56f72b9886080c873eb6f4d28acb7.zip |
Diffstat (limited to 'src/OSSupport/NetworkSingleton.h')
-rw-r--r-- | src/OSSupport/NetworkSingleton.h | 11 |
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); |