diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-08-31 03:22:41 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-09-12 12:50:53 +0200 |
commit | 7de28be76479796691730dcdc8c121543c5c9681 (patch) | |
tree | 1555f9d41b5ab9c136fe4e7d257783e2b2fd63af /drivers/unix | |
parent | d3108985e07d442aa90260b0830b3b46f9f4dcad (diff) |
ENet wrapper properly detect disconnect on poll
Now PacketPeerUDP.get_available_packet_count() return -1 if the socket
is in error state.
Diffstat (limited to 'drivers/unix')
-rw-r--r-- | drivers/unix/packet_peer_udp_posix.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index 1cb530420e..1c5456917b 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/drivers/unix/packet_peer_udp_posix.cpp @@ -61,7 +61,7 @@ int PacketPeerUDPPosix::get_available_packet_count() const { Error err = const_cast<PacketPeerUDPPosix *>(this)->_poll(false); if (err != OK) - return 0; + return -1; return queue_count; } |