summaryrefslogtreecommitdiff
path: root/drivers/unix/packet_peer_udp_posix.h
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2017-03-08 17:14:01 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2017-03-24 02:30:11 +0100
commit5f681d0b0f28cd39bc033c0cdf8eb3cb3a4acbe6 (patch)
tree5c94a8cc2537076223598b4007943e436cf750b4 /drivers/unix/packet_peer_udp_posix.h
parent38d457170a15fd9eb902cecc8c5dc401646cd0b8 (diff)
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.
Diffstat (limited to 'drivers/unix/packet_peer_udp_posix.h')
-rw-r--r--drivers/unix/packet_peer_udp_posix.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/unix/packet_peer_udp_posix.h b/drivers/unix/packet_peer_udp_posix.h
index b44ef49f2c..60d5bf6580 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: