From 7de28be76479796691730dcdc8c121543c5c9681 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 31 Aug 2018 03:22:41 +0200 Subject: ENet wrapper properly detect disconnect on poll Now PacketPeerUDP.get_available_packet_count() return -1 if the socket is in error state. --- drivers/windows/packet_peer_udp_winsock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/windows') diff --git a/drivers/windows/packet_peer_udp_winsock.cpp b/drivers/windows/packet_peer_udp_winsock.cpp index f7c3637e7e..62a23bdf3f 100644 --- a/drivers/windows/packet_peer_udp_winsock.cpp +++ b/drivers/windows/packet_peer_udp_winsock.cpp @@ -42,7 +42,7 @@ int PacketPeerUDPWinsock::get_available_packet_count() const { Error err = const_cast(this)->_poll(false); if (err != OK) - return 0; + return -1; return queue_count; } -- cgit v1.2.3