Skip to content
Snippets Groups Projects
Commit ba7a4fee authored by Dmitry E. Oboukhov's avatar Dmitry E. Oboukhov
Browse files

Add tests for socket:close closes #360

parent e7b32856
No related branches found
No related tags found
No related merge requests found
......@@ -814,13 +814,39 @@ string.sub(s:read(128), 1, 9)
---
- Tarantool
...
-- sa = { fh = 512 } setmetatable(sa, getmetatable(s))
-- tostring(sa)
-- sa:readable(0)
-- sa:writable(0)
-- ch = fiber.channel()
-- f = fiber.wrap(function() s:read(12) ch:put(true) end)
-- fiber.sleep(.1)
-- s:close()
-- ch:get(1)
-- s:error()
sa = { fh = 512 } setmetatable(sa, getmetatable(s))
---
...
tostring(sa)
---
- fd 512
...
sa:readable(0)
---
- true
...
sa:writable(0)
---
- true
...
ch = fiber.channel()
---
...
f = fiber.wrap(function() s:read(12) ch:put(true) end)
---
...
fiber.sleep(.1)
---
...
s:close()
---
- true
...
ch:get(1)
---
- true
...
s:error()
---
- Connection timed out
...
......@@ -260,14 +260,14 @@ socket.tcp_connect('127.0.0.1', 80, 0.00000000001)
s = socket.tcp_connect('127.0.0.1', primary_port)
string.sub(s:read(128), 1, 9)
-- sa = { fh = 512 } setmetatable(sa, getmetatable(s))
-- tostring(sa)
-- sa:readable(0)
-- sa:writable(0)
-- ch = fiber.channel()
-- f = fiber.wrap(function() s:read(12) ch:put(true) end)
-- fiber.sleep(.1)
-- s:close()
-- ch:get(1)
-- s:error()
sa = { fh = 512 } setmetatable(sa, getmetatable(s))
tostring(sa)
sa:readable(0)
sa:writable(0)
ch = fiber.channel()
f = fiber.wrap(function() s:read(12) ch:put(true) end)
fiber.sleep(.1)
s:close()
ch:get(1)
s:error()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment