summaryrefslogtreecommitdiff
path: root/core/io/packet_peer_udp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/packet_peer_udp.cpp')
-rw-r--r--core/io/packet_peer_udp.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp
index 9fec807bfb..769a513bb3 100644
--- a/core/io/packet_peer_udp.cpp
+++ b/core/io/packet_peer_udp.cpp
@@ -42,8 +42,8 @@ Error PacketPeerUDP::_set_dest_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_dest_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() {
- ClassDB::bind_method(_MD("set_ip_type","ip_type"),&PacketPeerUDP::set_ip_type);
- ClassDB::bind_method(_MD("listen:Error","port", "recv_buf_size"),&PacketPeerUDP::listen,DEFVAL(65536));
+ ClassDB::bind_method(_MD("listen:Error","port", "bind_address", "recv_buf_size"),&PacketPeerUDP::listen,DEFVAL("*"),DEFVAL(65536));
ClassDB::bind_method(_MD("close"),&PacketPeerUDP::close);
ClassDB::bind_method(_MD("wait:Error"),&PacketPeerUDP::wait);
ClassDB::bind_method(_MD("is_listening"),&PacketPeerUDP::is_listening);
@@ -87,5 +81,5 @@ PacketPeerUDP* PacketPeerUDP::create() {
PacketPeerUDP::PacketPeerUDP()
{
- ip_type = IP::TYPE_ANY;
+
}