From d3108985e07d442aa90260b0830b3b46f9f4dcad Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 31 Aug 2018 03:21:32 +0200 Subject: [PATCH] Properly reset socket blocking state on close --- drivers/unix/packet_peer_udp_posix.cpp | 1 + drivers/windows/packet_peer_udp_winsock.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index 1380c1d88b9..1cb530420ea 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/drivers/unix/packet_peer_udp_posix.cpp @@ -164,6 +164,7 @@ void PacketPeerUDPPosix::close() { ::close(sockfd); sockfd = -1; sock_type = IP::TYPE_NONE; + sock_blocking = true; rb.resize(16); queue_count = 0; } diff --git a/drivers/windows/packet_peer_udp_winsock.cpp b/drivers/windows/packet_peer_udp_winsock.cpp index 66221774b21..f7c3637e7e0 100644 --- a/drivers/windows/packet_peer_udp_winsock.cpp +++ b/drivers/windows/packet_peer_udp_winsock.cpp @@ -155,6 +155,7 @@ void PacketPeerUDPWinsock::close() { ::closesocket(sockfd); sockfd = -1; sock_type = IP::TYPE_NONE; + sock_blocking = true; rb.resize(16); queue_count = 0; }