Skip to content

Server | Design Abstract

Jasdac edited this page Mar 2, 2021 · 1 revision

Here's an abstract explanation on how the server works.

Socket.io Connections

  • A device sends its deviceID and some metadata to the server, and gets added to its own DeviceRoom. Only one connection can be in this room. Any other devices get booted when a new one of the same deviceID joins.
  • An app connects and sends a request to control a deviceID, and gets added to the device's AppRoom along with any other apps that are controlling it.
  • When a task is sent by the device, it's sent to the AppRoom for all apps to consume.
  • When a task is sent by the app, it's sent to the DeviceRoom for the single device.

REST

  • When a REST request is received that's targeted to a specific device. That request is sent to the DeviceRoom of that device.

Clone this wiki locally