diff options
Diffstat (limited to 'tests/Network/EchoServer.cpp')
-rw-r--r-- | tests/Network/EchoServer.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/Network/EchoServer.cpp b/tests/Network/EchoServer.cpp index 728db0b7c..2a420fbac 100644 --- a/tests/Network/EchoServer.cpp +++ b/tests/Network/EchoServer.cpp @@ -7,6 +7,7 @@ #include <iostream> #include <string> #include "OSSupport/Network.h" +#include "OSSupport/NetworkSingleton.h" @@ -98,7 +99,7 @@ class cEchoServerCallbacks: -int main() +static void DoTest(void) { LOGD("EchoServer: starting up"); cServerHandlePtr Server = cNetwork::Listen(9876, std::make_shared<cEchoServerCallbacks>()); @@ -118,10 +119,22 @@ int main() LOG("Server terminating."); Server->Close(); ASSERT(!Server->IsListening()); + Server.reset(); LOGD("Server has been closed."); +} + + + + + +int main() +{ + DoTest(); printf("Press enter to exit test.\n"); + AString line; std::getline(std::cin, line); + cNetworkSingleton::Get().Terminate(); LOG("Network test finished."); return 0; |