add close server function
This commit is contained in:
@@ -19,6 +19,8 @@ class Server {
|
|||||||
|
|
||||||
void CloseConnection(std::uint16_t a_PeerId);
|
void CloseConnection(std::uint16_t a_PeerId);
|
||||||
|
|
||||||
|
void CloseServer();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void HandleConnect(network::EnetConnection&);
|
void HandleConnect(network::EnetConnection&);
|
||||||
void HandleDisconnect(network::EnetConnection&);
|
void HandleDisconnect(network::EnetConnection&);
|
||||||
|
|||||||
@@ -73,5 +73,11 @@ void Server::CloseConnection(std::uint16_t a_PeerId) {
|
|||||||
m_NetworkServer.CloseConnection(a_PeerId);
|
m_NetworkServer.CloseConnection(a_PeerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Server::CloseServer() {
|
||||||
|
for (auto& [peerId, session] : m_Sessions) {
|
||||||
|
CloseConnection(peerId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace server
|
} // namespace server
|
||||||
} // namespace blitz
|
} // namespace blitz
|
||||||
|
|||||||
Reference in New Issue
Block a user