diff options
Diffstat (limited to 'core/io/ip.h')
| -rw-r--r-- | core/io/ip.h | 16 | 
1 files changed, 13 insertions, 3 deletions
diff --git a/core/io/ip.h b/core/io/ip.h index 38c86e7ba3..742dd0e740 100644 --- a/core/io/ip.h +++ b/core/io/ip.h @@ -48,6 +48,14 @@ public:  		RESOLVER_STATUS_ERROR,  	}; +	enum AddressType { + +		ADDRESS_IPV4 = 1, +		ADDRESS_IPV6 = 2, + +		ADDRESS_ANY = 3, +	}; +  	enum {  		RESOLVER_MAX_QUERIES = 32,  		RESOLVER_INVALID_ID=-1 @@ -65,7 +73,7 @@ protected:  	static IP*singleton;  	static void _bind_methods(); -	virtual IP_Address _resolve_hostname(const String& p_hostname)=0; +	virtual IP_Address _resolve_hostname(const String& p_hostname, IP_Address::AddrType p_type = IP_Address::TYPE_ANY)=0;  	Array _get_local_addresses() const;  	static IP* (*_create)(); @@ -73,14 +81,16 @@ public: -	IP_Address resolve_hostname(const String& p_hostname); +	IP_Address resolve_hostname(const String& p_hostname, IP_Address::AddrType p_type = IP_Address::TYPE_ANY);  	// async resolver hostname -	ResolverID resolve_hostname_queue_item(const String& p_hostname); +	ResolverID resolve_hostname_queue_item(const String& p_hostname, IP_Address::AddrType p_type = IP_Address::TYPE_ANY);  	ResolverStatus get_resolve_item_status(ResolverID p_id) const;  	IP_Address get_resolve_item_address(ResolverID p_id) const;  	virtual void get_local_addresses(List<IP_Address> *r_addresses) const=0;  	void erase_resolve_item(ResolverID p_id); +	void clear_cache(const String& p_hostname = ""); +  	static IP* get_singleton();  	static IP* create();  |