diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2016-12-05 16:32:38 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2016-12-09 18:24:59 +0100 |
commit | 1aff508dd9713abf0db0d0436fa7f7c4788c5a4a (patch) | |
tree | d3213c170d4e6aa90bf0bf2e62673728f2cac58c /drivers/unix/stream_peer_tcp_posix.cpp | |
parent | a77a0118f6b0d0878a53e2c963d91763b311163d (diff) | |
download | redot-engine-1aff508dd9713abf0db0d0436fa7f7c4788c5a4a.tar.gz |
IP_Address now handle IPv4 and IPv6 transparently
IP_Address changes:
- Converts to and from String transparently while handling IPv4 as IPv6
mapped (::ffff:[IP]) address internally.
- Completely remove AddrType enum.
- Setting/Getting of ip array is now only possible through dedicated functions
(ie. set_ipv4, get_ipv4, set_ipv6, get_ipv6)
- Add function to know if the address is a valid IPv4 (for IP implementation and enet)
Diffstat (limited to 'drivers/unix/stream_peer_tcp_posix.cpp')
-rw-r--r-- | drivers/unix/stream_peer_tcp_posix.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index fc6b08e64d..8889f997fd 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -141,7 +141,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.type == IP_Address::TYPE_NONE, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V( p_host == IP_Address(), ERR_INVALID_PARAMETER); sockfd = _socket_create(ip_type, SOCK_STREAM, IPPROTO_TCP); if (sockfd == -1) { |