aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_event.lua
diff options
context:
space:
mode:
Diffstat (limited to 'net/server_event.lua')
-rw-r--r--net/server_event.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/server_event.lua b/net/server_event.lua
index 1a3b8ca6..ef0a27d8 100644
--- a/net/server_event.lua
+++ b/net/server_event.lua
@@ -742,16 +742,14 @@ do
debug "need luasec, but not available"
return nil, "luasec not found"
end
- if not typ then
+ if getaddrinfo and not typ then
local addrinfo, err = getaddrinfo(addr)
if not addrinfo then return nil, err end
if addrinfo[1] and addrinfo[1].family == "inet6" then
typ = "tcp6"
- else
- typ = "tcp"
end
end
- local create = socket[typ]
+ local create = socket[typ or "tcp"]
if type( create ) ~= "function" then
return nil, "invalid socket type"
end