rpc: send ending packet in Server instead of UDPServer
udp_server might not be created due to error (occupied port etc.), in which case its destructor and thread-ending call chain will not be excuted in Server::Stop. However, the ending packet still need to be send no matter udp is on or not, so move it to Server::Stop
This commit is contained in:
parent
5f80075c31
commit
870579d38f
2 changed files with 2 additions and 4 deletions
|
@ -25,6 +25,7 @@ void Server::Start() {
|
|||
|
||||
void Server::Stop() {
|
||||
udp_server.reset();
|
||||
NewRequestCallback(nullptr); // Notify the RPC server to end
|
||||
}
|
||||
|
||||
void Server::NewRequestCallback(std::unique_ptr<RPC::Packet> new_request) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue