aboutsummaryrefslogtreecommitdiff
path: root/core/io/packet_peer_udp.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2017-03-23 08:29:08 +0100
committerGitHub2017-03-23 08:29:08 +0100
commitaaf4e3ab9f8ffca22b34b63aaaf8cc87ead22e48 (patch)
treeed6abd04f1d1ef9bf3bfb92761ed8a58b137a476 /core/io/packet_peer_udp.cpp
parenta14ad02d155da315b247c03337d98e151b504c61 (diff)
parent15ecdb5f00da2f19974d70ddd8f2658d9f2f4903 (diff)
downloadgodot-aaf4e3ab9f8ffca22b34b63aaaf8cc87ead22e48.tar.gz
godot-aaf4e3ab9f8ffca22b34b63aaaf8cc87ead22e48.tar.zst
godot-aaf4e3ab9f8ffca22b34b63aaaf8cc87ead22e48.zip
Merge pull request #8108 from Faless/2.1-v6fix-cherry
Cherry pick #7510 and #7581 to 2.1
Diffstat (limited to 'core/io/packet_peer_udp.cpp')
-rw-r--r--core/io/packet_peer_udp.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp
index eb51a4207..067c1c1bd 100644
--- a/core/io/packet_peer_udp.cpp
+++ b/core/io/packet_peer_udp.cpp
@@ -42,8 +42,8 @@ Error PacketPeerUDP::_set_send_address(const String &p_address, int p_port) {
if (p_address.is_valid_ip_address()) {
ip = p_address;
} else {
- ip = IP::get_singleton()->resolve_hostname(p_address, ip_type);
- if (ip == IP_Address())
+ ip = IP::get_singleton()->resolve_hostname(p_address);
+ if (!ip.is_valid())
return ERR_CANT_RESOLVE;
}
@@ -51,15 +51,9 @@ Error PacketPeerUDP::_set_send_address(const String &p_address, int p_port) {
return OK;
}
-void PacketPeerUDP::set_ip_type(IP::Type p_type) {
- close();
- ip_type = p_type;
-}
-
void PacketPeerUDP::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("set_ip_type", "ip_type"), &PacketPeerUDP::set_ip_type);
- ObjectTypeDB::bind_method(_MD("listen:Error", "port", "recv_buf_size"), &PacketPeerUDP::listen, DEFVAL(65536));
+ ObjectTypeDB::bind_method(_MD("listen:Error", "port", "bind_address", "recv_buf_size"), &PacketPeerUDP::listen, DEFVAL("*"), DEFVAL(65536));
ObjectTypeDB::bind_method(_MD("close"), &PacketPeerUDP::close);
ObjectTypeDB::bind_method(_MD("wait:Error"), &PacketPeerUDP::wait);
ObjectTypeDB::bind_method(_MD("is_listening"), &PacketPeerUDP::is_listening);
@@ -84,5 +78,4 @@ PacketPeerUDP *PacketPeerUDP::create() {
}
PacketPeerUDP::PacketPeerUDP() {
- ip_type = IP::TYPE_ANY;
}