diff options
| author | Fabio Alessandrelli | 2017-03-08 17:14:01 +0100 |
|---|---|---|
| committer | Fabio Alessandrelli | 2017-03-24 02:30:11 +0100 |
| commit | 5f681d0b0f28cd39bc033c0cdf8eb3cb3a4acbe6 (patch) | |
| tree | 5c94a8cc2537076223598b4007943e436cf750b4 /core/io/packet_peer_udp.cpp | |
| parent | 38d457170a15fd9eb902cecc8c5dc401646cd0b8 (diff) | |
| download | godot-5f681d0b0f28cd39bc033c0cdf8eb3cb3a4acbe6.tar.gz godot-5f681d0b0f28cd39bc033c0cdf8eb3cb3a4acbe6.tar.zst godot-5f681d0b0f28cd39bc033c0cdf8eb3cb3a4acbe6.zip | |
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 'core/io/packet_peer_udp.cpp')
| -rw-r--r-- | core/io/packet_peer_udp.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp index 46accf420..3bc116f1b 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; } |
