Skip to content

Commit fc5f86f

Browse files
committed
fix: shutdown -> close for UDP servers.
- Although shutdown works on Linux to remove a file descriptor from the internal poll event loop, it isn't a portable approach. Instead I have replaced the call to shutdown with a call to close.
1 parent 7b8a11a commit fc5f86f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/net/service/impl/async_udp_service_impl.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ template <typename UDPStreamHandler, std::size_t Size>
117117
auto async_udp_service<UDPStreamHandler, Size>::stop_() -> void
118118
{
119119
using namespace io::socket;
120+
using io::socket::close;
121+
120122
auto sockfd = server_sockfd_.exchange(INVALID_SOCKET);
121-
shutdown(sockfd, SHUT_RD);
123+
close(sockfd);
122124
}
123125

124126
} // namespace net::service

0 commit comments

Comments
 (0)