summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2017-01-18 10:24:26 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2017-01-23 20:18:18 +0100
commit2fe4ef66991b483640f59873c22b3af671626ccc (patch)
tree2ddc072d59d6f8ceed594b669e6dfab5b1bf6c29 /core/io
parentb2839343cab66880f647c77da7b2e1826761776a (diff)
Implement UDP listen bind address
Diffstat (limited to 'core/io')
-rw-r--r--core/io/packet_peer_udp.cpp2
-rw-r--r--core/io/packet_peer_udp.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp
index 4756d1699b..3ea5e878f6 100644
--- a/core/io/packet_peer_udp.cpp
+++ b/core/io/packet_peer_udp.cpp
@@ -59,7 +59,7 @@ void PacketPeerUDP::set_ip_type(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);
diff --git a/core/io/packet_peer_udp.h b/core/io/packet_peer_udp.h
index 17952b4ac1..e0e560de1e 100644
--- a/core/io/packet_peer_udp.h
+++ b/core/io/packet_peer_udp.h
@@ -45,12 +45,12 @@ protected:
String _get_packet_ip() const;
- virtual Error _set_dest_address(const String& p_address,int p_port);
+ Error _set_dest_address(const String& p_address,int p_port);
public:
virtual void set_ip_type(IP::Type p_type);
- virtual Error listen(int p_port, int p_recv_buffer_size=65536)=0;
+ 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;
virtual bool is_listening() const=0;