uNetworking / uWebSockets.js

μWebSockets for Node.js back-ends :metal:
Apache License 2.0
8.08k stars 574 forks source link

publish returns undefined? #746

Closed vedantroy closed 2 years ago

vedantroy commented 2 years ago

The Typescript bindings say app.publish returns a boolean, but it seems like the return value can also be undefined?

  const ret = app.publish(opts.chan, opts.bytes, opts.isBinary, opts.compress);
// prints undefined
  console.log(ret);
vedantroy commented 2 years ago

The context for this question is: I have an application where ws.send is successfully sending data back to the client, but app.publish is not sending anything.

vedantroy commented 2 years ago

Update: I should have been passing in strings (not buffers).