We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ade24f commit a74815cCopy full SHA for a74815c
2 files changed
spec/server_ev_spec.lua
@@ -31,6 +31,19 @@ describe(
31
s:close()
32
end)
33
34
+ it(
35
+ 's:sock() provides access to the listening socket',
36
+ function()
37
+ local s = server.ev.listen
38
+ {
39
+ default = function() end,
40
+ port = port
41
+ }
42
+ assert.is_truthy(tostring(s:sock()):match('tcp'))
43
+ s:close()
44
+ end)
45
+
46
47
it(
48
'call listen with protocol handlers',
49
function()
src/websocket/server_ev.lua
@@ -166,6 +166,11 @@ local listen = function(opts)
166
error(err)
167
end
168
listener:settimeout(0)
169
170
+ self.sock = function()
171
+ return listener
172
+ end
173
174
local listen_io = ev.IO.new(
175
176
local client_sock = listener:accept()
0 commit comments