diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2016-10-28 04:18:17 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2016-10-30 17:46:05 +0100 |
commit | 812908e236e83db368dfef49b8badb9a6182e1de (patch) | |
tree | 013cf2b81d6d9bbdca87b9362f2c1abee94b6e74 /drivers/unix/stream_peer_tcp_posix.cpp | |
parent | ee69bd81cfa67eb5c642604f0f43d711ab370faf (diff) | |
download | redot-engine-812908e236e83db368dfef49b8badb9a6182e1de.tar.gz |
Fix windows debugger connection problems.
Unify network socket creation between platform.
Ensure IPV6_V6ONLY flag is not set on sockets (allow IPv4 connection in IPv6 socket, dual-stack).
Diffstat (limited to 'drivers/unix/stream_peer_tcp_posix.cpp')
-rw-r--r-- | drivers/unix/stream_peer_tcp_posix.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index f2915b0a16..b1636abd69 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -137,8 +137,8 @@ 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); - int family = p_host.type == IP_Address::TYPE_IPV6 ? AF_INET6 : AF_INET; - if ((sockfd = socket(family, SOCK_STREAM, 0)) == -1) { + sockfd = _socket_create(p_host.type, SOCK_STREAM, IPPROTO_TCP); + if (sockfd == -1) { ERR_PRINT("Socket creation failed!"); disconnect(); //perror("socket"); |