aboutsummaryrefslogtreecommitdiff
path: root/drivers/unix/packet_peer_udp_posix.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli2016-10-28 04:18:17 +0200
committerFabio Alessandrelli2016-10-30 17:46:05 +0100
commit812908e236e83db368dfef49b8badb9a6182e1de (patch)
tree013cf2b81d6d9bbdca87b9362f2c1abee94b6e74 /drivers/unix/packet_peer_udp_posix.cpp
parentee69bd81cfa67eb5c642604f0f43d711ab370faf (diff)
downloadgodot-812908e236e83db368dfef49b8badb9a6182e1de.tar.gz
godot-812908e236e83db368dfef49b8badb9a6182e1de.tar.zst
godot-812908e236e83db368dfef49b8badb9a6182e1de.zip
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 0b172b6a5..01c26420a 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;
}