┌───────────────┐ Connects with LWT message ┌───────────────┐
│ IoT Device │──────────────────────────────────────▶│ Server │
└───────────────┘ └───────────────┘
│ │
│ │
│ Unexpected disconnect │
│─────────────────────────────────────────────────────▶│
│ │
│ Publishes LWT message
│ │
▼ ▼
┌───────────────┐ ┌───────────────┐
│ Other Devices │◀──────────────────────────────────────│ Server │
└───────────────┘ Receives LWT alert └───────────────┘This diagram shows how an IoT device sends an LWT message to the server, which publishes it to other devices if the original device disconnects unexpectedly.