From 2fe4ef66991b483640f59873c22b3af671626ccc Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Wed, 18 Jan 2017 10:24:26 +0100 Subject: Implement UDP listen bind address --- core/io/packet_peer_udp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/io/packet_peer_udp.h') 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; -- cgit v1.2.3 From 88a56ba783d36d52a1023759e69f026b1ae255b4 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Wed, 18 Jan 2017 12:47:12 +0100 Subject: Remove set_ip_type from network classes (no longer needed) - TCP: - `listen` bind to wildcard "*" -> dual stack socket - `listen` bind to address -> socket from address type - `connect` -> resolve using best protocol (UNSPEC), socket from address type - UDP: - `listen` bind to wildcard "*" -> dual stack socket - `listen` bind to address -> socket from address type - `put_packet`/`put_var` -> resolve using TYPE_ANY (UNSPEC), socket from address type (to change socket type you must first call `close` it) --- core/io/packet_peer_udp.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'core/io/packet_peer_udp.h') diff --git a/core/io/packet_peer_udp.h b/core/io/packet_peer_udp.h index e0e560de1e..726406887c 100644 --- a/core/io/packet_peer_udp.h +++ b/core/io/packet_peer_udp.h @@ -38,8 +38,6 @@ class PacketPeerUDP : public PacketPeer { protected: - IP::Type ip_type; - static PacketPeerUDP* (*_create)(); static void _bind_methods(); @@ -49,7 +47,6 @@ protected: public: - virtual void set_ip_type(IP::Type p_type); 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; -- cgit v1.2.3