1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Convert validity checks of IP_Address to is_valid method.

(cherry picked from commit 98a7e2b4e0)
This commit is contained in:
Fabio Alessandrelli
2017-01-17 09:22:56 +01:00
parent aeffe74a27
commit 603105df18
9 changed files with 30 additions and 11 deletions

View File

@@ -142,7 +142,7 @@ void StreamPeerTCPPosix::set_socket(int p_sockfd, IP_Address p_host, int p_port,
Error StreamPeerTCPPosix::connect(const IP_Address &p_host, uint16_t p_port) {
ERR_FAIL_COND_V(p_host == IP_Address(), ERR_INVALID_PARAMETER);
ERR_FAIL_COND_V(!p_host.is_valid(), ERR_INVALID_PARAMETER);
sock_type = p_host.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6;
sockfd = _socket_create(sock_type, SOCK_STREAM, IPPROTO_TCP);