Note that there are some explanatory texts on larger screens.

plurals
  1. POExpress.io can not emit events when routed from http request
    primarykey
    data
    text
    <pre><code>Here i use those codes: // Initial web request. app.get('/hello', function(req, res) { // Forward to an io route. req.io.route('hello') }) app.io.route('hello', function(req) { //Here use emit req.io.emit("world","world"); }) </code></pre> <p>it report an error as follow:</p> <pre><code>TypeError: Object #&lt;Object&gt; has no method 'emit' at Object.hello (/Users/wensonsmith/ProjectX/Server/app.js:44:12) at Manager.io.route (/Users/wensonsmith/ProjectX/Server/node_modules/express.io/lib/index.coffee:65:29) at Object.request.io.route (/Users/wensonsmith/ProjectX/Server/node_modules/express.io/lib/index.coffee:143:29) at /Users/wensonsmith/ProjectX/Server/app.js:39:12 at callbacks (/Users/wensonsmith/ProjectX/Server/node_modules/express.io/node_modules/express/lib/router/index.js:160:37) at param (/Users/wensonsmith/ProjectX/Server/node_modules/express.io/node_modules/express/lib/router/index.js:134:11) at pass (/Users/wensonsmith/ProjectX/Server/node_modules/express.io/node_modules/express/lib/router/index.js:141:5) at Router._dispatch (/Users/wensonsmith/ProjectX/Server/node_modules/express.io/node_modules/express/lib/router/index.js:169:5) at Object.router (/Users/wensonsmith/ProjectX/Server/node_modules/express.io/node_modules/express/lib/router/index.js:32:10) at next (/Users/wensonsmith/ProjectX/Server/node_modules/express.io/node_modules/connect/lib/proto.js:190:15) </code></pre> <p>req.io.respond is OK .</p> <p>Broadcast is also have some problem.It can broadcast ,but it doesn't stop after broadcast. it run for a long while ,then return nothing ,and no error messages.</p> <p>My code is</p> <pre><code>// Initial web request. app.get('/hello', function(req, res) { // Forward to an io route. req.io.route('hello') }) // Forward io route to another io route. app.io.route('hello', function(req) { req.io.broadcast("world","world"); }) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload