From 6e0de0cce81ee8972dc997279c2c830f7b412b4d Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 27 Oct 2016 05:54:42 +0200 Subject: [PATCH] TCPServer listen now default to IP type ANY (v6 socket with v4 support) (cherry picked from commit ee69bd81cfa67eb5c642604f0f43d711ab370faf) --- core/io/packet_peer_udp.h | 2 +- core/io/tcp_server.h | 4 ++-- drivers/unix/tcp_server_posix.h | 2 +- platform/windows/tcp_server_winsock.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/io/packet_peer_udp.h b/core/io/packet_peer_udp.h index c0806a9e6a..6c79104e43 100644 --- a/core/io/packet_peer_udp.h +++ b/core/io/packet_peer_udp.h @@ -46,7 +46,7 @@ protected: public: - virtual Error listen(int p_port, IP_Address::AddrType p_address_type = IP_Address::TYPE_IPV4, int p_recv_buffer_size=65536)=0; + virtual Error listen(int p_port, IP_Address::AddrType p_address_type = IP_Address::TYPE_ANY, int p_recv_buffer_size=65536)=0; virtual void close()=0; virtual Error wait()=0; virtual bool is_listening() const=0; diff --git a/core/io/tcp_server.h b/core/io/tcp_server.h index 883a3ef2f6..0267895008 100644 --- a/core/io/tcp_server.h +++ b/core/io/tcp_server.h @@ -41,11 +41,11 @@ protected: static TCP_Server* (*_create)(); //bind helper - Error _listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_IPV4 ,DVector p_accepted_hosts=DVector()); + Error _listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_ANY ,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_IPV4, const List *p_accepted_hosts=NULL)=0; + virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_ANY, const List *p_accepted_hosts=NULL)=0; virtual bool is_connection_available() const=0; virtual Ref take_connection()=0; diff --git a/drivers/unix/tcp_server_posix.h b/drivers/unix/tcp_server_posix.h index 134ec494cb..a700b6ae0e 100644 --- a/drivers/unix/tcp_server_posix.h +++ b/drivers/unix/tcp_server_posix.h @@ -40,7 +40,7 @@ class TCPServerPosix : public TCP_Server { public: - virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_IPV4, const List *p_accepted_hosts=NULL); + virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type, const List *p_accepted_hosts=NULL); virtual bool is_connection_available() const; virtual Ref take_connection(); diff --git a/platform/windows/tcp_server_winsock.h b/platform/windows/tcp_server_winsock.h index 94601a2e12..115fdb4234 100644 --- a/platform/windows/tcp_server_winsock.h +++ b/platform/windows/tcp_server_winsock.h @@ -39,7 +39,7 @@ class TCPServerWinsock : public TCP_Server { public: - virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_IPV4,const List *p_accepted_hosts=NULL); + virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type,const List *p_accepted_hosts=NULL); virtual bool is_connection_available() const; virtual Ref take_connection();