summaryrefslogtreecommitdiffstats
path: root/drivers/unix/packet_peer_udp_posix.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2016-10-28 04:18:17 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2016-10-30 17:46:05 +0100
commit812908e236e83db368dfef49b8badb9a6182e1de (patch)
tree013cf2b81d6d9bbdca87b9362f2c1abee94b6e74 /drivers/unix/packet_peer_udp_posix.cpp
parentee69bd81cfa67eb5c642604f0f43d711ab370faf (diff)
downloadredot-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/packet_peer_udp_posix.cpp')
-rw-r--r--drivers/unix/packet_peer_udp_posix.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp
index 0b172b6a51..01c26420a8 100644
--- a/drivers/unix/packet_peer_udp_posix.cpp
+++ b/drivers/unix/packet_peer_udp_posix.cpp
@@ -121,8 +121,6 @@ int PacketPeerUDPPosix::get_max_packet_size() const{
Error PacketPeerUDPPosix::listen(int p_port, IP_Address::AddrType p_address_type, int p_recv_buffer_size) {
- ERR_FAIL_COND_V(p_address_type != IP_Address::TYPE_IPV4 && p_address_type != IP_Address::TYPE_IPV6, ERR_INVALID_PARAMETER);
-
close();
int sock = _get_socket(p_address_type);
if (sock == -1 )
@@ -223,11 +221,7 @@ int PacketPeerUDPPosix::_get_socket(IP_Address::AddrType p_type) {
if (sockfd != -1)
return sockfd;
- int family = p_type == IP_Address::TYPE_IPV6 ? AF_INET6 : AF_INET;
-
- sockfd = socket(family, SOCK_DGRAM, IPPROTO_UDP);
- ERR_FAIL_COND_V( sockfd == -1, -1 );
- //fcntl(sockfd, F_SETFL, O_NONBLOCK);
+ sockfd = _socket_create(p_type, SOCK_DGRAM, IPPROTO_UDP);
return sockfd;
}