浏览代码

TCPServer listen now default to IP type ANY (v6 socket with v4 support)

Fabio Alessandrelli 8 年之前
父节点
当前提交
ee69bd81cf
共有 4 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      core/io/packet_peer_udp.h
  2. 2 2
      core/io/tcp_server.h
  3. 1 1
      drivers/unix/tcp_server_posix.h
  4. 1 1
      platform/windows/tcp_server_winsock.h

+ 1 - 1
core/io/packet_peer_udp.h

@@ -46,7 +46,7 @@ protected:
 
 
 public:
 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 void close()=0;
 	virtual Error wait()=0;
 	virtual Error wait()=0;
 	virtual bool is_listening() const=0;
 	virtual bool is_listening() const=0;

+ 2 - 2
core/io/tcp_server.h

@@ -41,11 +41,11 @@ protected:
 	static TCP_Server* (*_create)();
 	static TCP_Server* (*_create)();
 
 
 	//bind helper
 	//bind helper
-	Error _listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_IPV4 ,DVector<String> p_accepted_hosts=DVector<String>());
+	Error _listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_ANY ,DVector<String> p_accepted_hosts=DVector<String>());
 	static void _bind_methods();
 	static void _bind_methods();
 public:
 public:
 
 
-	virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_IPV4, const List<String> *p_accepted_hosts=NULL)=0;
+	virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_ANY, const List<String> *p_accepted_hosts=NULL)=0;
 	virtual bool is_connection_available() const=0;
 	virtual bool is_connection_available() const=0;
 	virtual Ref<StreamPeerTCP> take_connection()=0;
 	virtual Ref<StreamPeerTCP> take_connection()=0;
 
 

+ 1 - 1
drivers/unix/tcp_server_posix.h

@@ -40,7 +40,7 @@ class TCPServerPosix : public TCP_Server {
 
 
 public:
 public:
 
 
-	virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_IPV4, const List<String> *p_accepted_hosts=NULL);
+	virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type, const List<String> *p_accepted_hosts=NULL);
 	virtual bool is_connection_available() const;
 	virtual bool is_connection_available() const;
 	virtual Ref<StreamPeerTCP> take_connection();
 	virtual Ref<StreamPeerTCP> take_connection();
 
 

+ 1 - 1
platform/windows/tcp_server_winsock.h

@@ -39,7 +39,7 @@ class TCPServerWinsock : public TCP_Server {
 
 
 public:
 public:
 
 
-	virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_IPV4,const List<String> *p_accepted_hosts=NULL);
+	virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type,const List<String> *p_accepted_hosts=NULL);
 	virtual bool is_connection_available() const;
 	virtual bool is_connection_available() const;
 	virtual Ref<StreamPeerTCP> take_connection();
 	virtual Ref<StreamPeerTCP> take_connection();