1 Commits

Author SHA1 Message Date
b06176823d Allow CC and LD to be overrriden 2020-04-14 16:55:02 -03:00
5 changed files with 12 additions and 26 deletions

View File

@ -283,11 +283,11 @@ SOCKET=$(SOCKET_$(PLAT))
#------
# Settings selected for platform
#
CC=$(CC_$(PLAT))
CC?=$(CC_$(PLAT))
DEF=$(DEF_$(PLAT))
CFLAGS=$(MYCFLAGS) $(CFLAGS_$(PLAT))
LDFLAGS=$(MYLDFLAGS) $(LDFLAGS_$(PLAT))
LD=$(LD_$(PLAT))
LD?=$(LD_$(PLAT))
LUAINC= $(LUAINC_$(PLAT))
LUALIB= $(LUALIB_$(PLAT))

View File

@ -10,7 +10,7 @@ ulimit -n
You'll probably need to be root to do this.
]]
socket = require "socket"
require "socket"
host = arg[1] or "google.com"
port = arg[2] or 80

View File

@ -1,35 +1,21 @@
#!/usr/bin/env lua
local socket = require"socket"
require"socket"
port = 8765
function pcalltest(msg, o, opt)
local a = { pcall(o.getoption, o, opt) }
if a[1] then
print(msg, opt, unpack(a))
else
print(msg, opt, 'fail: ' .. a[2])
end
end
function options(o)
print("options for", o)
for _, opt in ipairs{
"keepalive", "reuseaddr",
"tcp-nodelay", "tcp-keepidle", "tcp-keepcnt", "tcp-keepintvl"} do
pcalltest("getoption", o, opt)
print("getoption", opt, o:getoption(opt))
end
r = o:getoption'linger'
if r then
print("getoption", "linger",
"on", r.on,
"timeout", r.timeout)
else
print("getoption", "linger", "no result")
end
print("getoption", "linger",
"on", o:getoption("linger").on,
"timeout", o:getoption("linger").timeout)
end
local m = socket.tcp()

View File

@ -1,4 +1,4 @@
#!/usr/bin/env lua
#!/usr/bin/lua
--[[
Show that luasocket returns an error message on zero-length UDP sends,
@ -12,7 +12,7 @@ listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes
]]
socket = require"socket"
require"socket"
s = assert(socket.udp())
r = assert(socket.udp())

View File

@ -1,4 +1,4 @@
#!/usr/bin/env lua
#!/usr/bin/lua
--[[
Show that luasocket returns an error message on zero-length UDP sends,
@ -12,7 +12,7 @@ listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes
]]
socket = require"socket"
require"socket"
s = assert(socket.udp())
r = assert(socket.udp())