Fixed functions that return messages in ?socket.c.
Moved complexity of connect and accept there. Created a new options.c module to take care of options. Auxiliar.c is now cleaner.
This commit is contained in:
parent
e63f500d24
commit
195069cf5f
16 changed files with 284 additions and 275 deletions
|
@ -378,6 +378,19 @@ function connect_timeout()
|
|||
c:close()
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------
|
||||
function rebind_test()
|
||||
local c = socket.bind("localhost", 0)
|
||||
local i, p = c:getsockname()
|
||||
local s, e = socket.tcp()
|
||||
assert(s, e)
|
||||
s:setoption("reuseaddr", false)
|
||||
r, e = s:bind("localhost", p)
|
||||
assert(not r, "managed to rebind!")
|
||||
assert(e == "address already in use")
|
||||
print("ok")
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------
|
||||
test("method registration")
|
||||
test_methods(socket.tcp(), {
|
||||
|
@ -416,6 +429,9 @@ test_selectbugs()
|
|||
test("empty host connect: ")
|
||||
empty_connect()
|
||||
|
||||
test("rebinding: ")
|
||||
rebind_test()
|
||||
|
||||
test("active close: ")
|
||||
active_close()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue