Maximum Number of Namespaces/Rooms #4754
-
I'm considering using Socket.IO for an IoT application where I want devices to be able to send telemetry to a server and receive commands from a server. Since telemetry and commands will be handled by different parts of the application, I'm considering using Namespaces for this. The different namespaces would be something like: On the server I would create a matching wildcard to handle messages and connections from devices. I guess my questions are the following
Thank you 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi!
Without knowing all details of your application, it's a bit hard to tell, but maybe one namespace for telemetry and one for commands would suit your need: io.of("/telemetry").on("connection", (socket) => {
socket.join(<device-uuid>);
io.to(<device-uuid>).emit(...);
socket.on(...);
});
io.of("/commands").on("connection", (socket) => {
socket.join(<device-uuid>);
io.to(<device-uuid>).emit(...);
socket.on(...);
}); This way, the telemetry events are cleanly split from the commands events.
No, there is no special limits. |
Beta Was this translation helpful? Give feedback.
Hi!
Without knowing all details of your application, it's a bit hard to tell, but maybe one namespace for telemetry and one for commands would suit your need:
This way, the telemetry events are cleanly split from the commands events.
No,…