You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user