Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websocket: attempt to yield across C-call boundary #5

Open
ghost opened this issue Jun 24, 2015 · 0 comments
Open

websocket: attempt to yield across C-call boundary #5

ghost opened this issue Jun 24, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 24, 2015

Writing to a websocket from a timer-callback fails:

local weblit = require("weblit")
local timer = require("timer")

weblit.app
.bind({host = "127.0.0.1", port = 1337})
.use(weblit.logger)
.use(weblit.autoHeaders)
.use(weblit.websocket({path = '/ws', host = '127.0.0.1'}, function(req, read, write)
  for thing in read do
      p(thing)
      timer.setTimeout(1000, function()
          print("timeout")
          write({opcode = 1; payload = "websocket-hello"})
      end)
  end
  write()
end))
.start()

...the same happens if I try to write to a websocket from a childprocess's on('exit') callback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants