diff options
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/packet_peer_udp.cpp | 7 | ||||
-rw-r--r-- | core/io/packet_peer_udp.h | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp index 46accf420a..3bc116f1b6 100644 --- a/core/io/packet_peer_udp.cpp +++ b/core/io/packet_peer_udp.cpp @@ -31,6 +31,11 @@ PacketPeerUDP *(*PacketPeerUDP::_create)() = NULL; +void PacketPeerUDP::set_blocking_mode(bool p_enable) { + + blocking = p_enable; +} + String PacketPeerUDP::_get_packet_ip() const { return get_packet_address(); @@ -78,4 +83,6 @@ PacketPeerUDP *PacketPeerUDP::create() { } PacketPeerUDP::PacketPeerUDP() { + + blocking = true; } diff --git a/core/io/packet_peer_udp.h b/core/io/packet_peer_udp.h index c316faad4b..c486f443fb 100644 --- a/core/io/packet_peer_udp.h +++ b/core/io/packet_peer_udp.h @@ -36,6 +36,8 @@ class PacketPeerUDP : public PacketPeer { GDCLASS(PacketPeerUDP, PacketPeer); protected: + bool blocking; + static PacketPeerUDP *(*_create)(); static void _bind_methods(); @@ -44,6 +46,8 @@ protected: Error _set_dest_address(const String &p_address, int p_port); public: + void set_blocking_mode(bool p_enable); + virtual Error listen(int p_port, IP_Address p_bind_address = IP_Address("*"), int p_recv_buffer_size = 65536) = 0; virtual void close() = 0; virtual Error wait() = 0; |