mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-04-11 19:28:30 +00:00
Fixed problem that listen may return incorrect value when calling stop;
This commit is contained in:
@@ -1516,9 +1516,10 @@ inline void Server::stop()
|
||||
{
|
||||
if (is_running_) {
|
||||
assert(svr_sock_ != INVALID_SOCKET);
|
||||
detail::shutdown_socket(svr_sock_);
|
||||
detail::close_socket(svr_sock_);
|
||||
auto sock = svr_sock_;
|
||||
svr_sock_ = INVALID_SOCKET;
|
||||
detail::shutdown_socket(sock);
|
||||
detail::close_socket(sock);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user