From a46a643f90b4a5e93f94e9223e58a7bf83dc4e2a Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Wed, 30 Nov 2016 20:45:19 +0100 Subject: Use an instance variable for ip_type in raw sockets PacketPeerUDP/StreamPeerTCP/TCP_Server now uses an instance variable to store the selected ip_type (IPv4/IPv6/ANY, where ANY = dual stack). All calls to resolve addresses, sending/receving data, connecting/listening will use that socket type. (cherry picked from commit 95bdd977686005d3d813eb09aca625384f1774c1) --- core/io/tcp_server.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/io/tcp_server.h') diff --git a/core/io/tcp_server.h b/core/io/tcp_server.h index 026789500..c380db52d 100644 --- a/core/io/tcp_server.h +++ b/core/io/tcp_server.h @@ -38,14 +38,16 @@ class TCP_Server : public Reference { OBJ_TYPE( TCP_Server, Reference ); protected: + IP_Address::AddrType ip_type; + static TCP_Server* (*_create)(); //bind helper - Error _listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_ANY ,DVector p_accepted_hosts=DVector()); + Error _listen(uint16_t p_port, DVector p_accepted_hosts=DVector()); static void _bind_methods(); public: - virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_ANY, const List *p_accepted_hosts=NULL)=0; + virtual Error listen(uint16_t p_port, const List *p_accepted_hosts=NULL)=0; virtual bool is_connection_available() const=0; virtual Ref take_connection()=0; -- cgit v1.2.3-70-g09d2