diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-03-24 22:47:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-24 22:47:18 +0100 |
commit | 296ece2c6a61630bfdb9b31dce46e5e2d1cda7cf (patch) | |
tree | 934c3f266fa8a76bab60f68a6ab825236b7e7959 /core/io | |
parent | f1e05d31444f46906e8bd155c0dd7d7a9a018451 (diff) | |
parent | 0450e6539ea77f8c56b244aef27ec45c69e1dcdb (diff) |
Merge pull request #7985 from Faless/enet_godot_sock_squash
Update ENet to use Godot sockets.
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; |