Closed sudarshanmg closed 7 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
socket-io-website | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jan 22, 2024 5:14pm |
Hi! I don't think this is right:
socket.timeout(500).emit("new_msg", (err, response) => {
// single response
});
io.timeout(500).emit("new_msg", (err, responses) => {
// multiple responses
});
Could you please check?
My bad, you're right. Sorry!
No problem, have a great day!
The returned response is an array and not an object.
The index.html file:![image](https://github.com/socketio/socket.io-website/assets/86506425/58de91f2-61c9-4308-b5df-158b7518b639)
Quick fix:
console.log(response[0].status)
Which gives the expected output:![image](https://github.com/socketio/socket.io-website/assets/86506425/5ae7c0d2-0e59-4a76-8fc6-9132f4548114)