MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / stopServer

Method stopServer

source/network/ODSocketServer.cpp:127–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void ODSocketServer::stopServer()
128{
129 mIsConnected = false;
130 if(mThread != nullptr)
131 delete mThread; // Delete waits for the thread to finish
132 mThread = nullptr;
133 mSockSelector.clear();
134 mSockListener.close();
135 for (std::vector<ODSocketClient*>::iterator it = mSockClients.begin(); it != mSockClients.end(); ++it)
136 {
137 ODSocketClient* client = *it;
138 client->disconnect();
139 delete client;
140 }
141
142 mSockClients.clear();
143}

Callers

nothing calls this directly

Calls 2

clearMethod · 0.80
disconnectMethod · 0.45

Tested by

no test coverage detected