From 5f681d0b0f28cd39bc033c0cdf8eb3cb3a4acbe6 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Wed, 8 Mar 2017 17:14:01 +0100 Subject: Allow non blocking UDP put_packet in C++. - Add blocking mode option to PacketPeerUDP. - put_packet returns ERR_UNAVAILABLE when operation would block. - ENet module uses non-blocking UDP. --- drivers/unix/packet_peer_udp_posix.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/unix/packet_peer_udp_posix.h') diff --git a/drivers/unix/packet_peer_udp_posix.h b/drivers/unix/packet_peer_udp_posix.h index b44ef49f2..60d5bf658 100644 --- a/drivers/unix/packet_peer_udp_posix.h +++ b/drivers/unix/packet_peer_udp_posix.h @@ -47,6 +47,7 @@ class PacketPeerUDPPosix : public PacketPeerUDP { mutable int packet_port; mutable int queue_count; int sockfd; + bool sock_blocking; IP::Type sock_type; IP_Address peer_addr; @@ -55,6 +56,7 @@ class PacketPeerUDPPosix : public PacketPeerUDP { _FORCE_INLINE_ int _get_socket(); static PacketPeerUDP *_create(); + void _set_sock_blocking(bool p_blocking); virtual Error _poll(bool p_block); public: -- cgit v1.2.3-70-g09d2