Skip to content

Server module ​

提示

Version 2.0 update: the MQTT, TCP, and UDP servers based on the Netty architecture have been integrated, with sessions and devices of the three servers managed uniformly.

1. Configuration File ​

Let's look at how to start and stop services in the configuration file. Each service is controlled by enabled, and MQTT and WebSocket are started and stopped together.
Configuration file screenshot

In the backend code, the server management modules are as follows:
Configuration file screenshotConfiguration file screenshot

  1. boot-strap manages the startup of each server
  2. iot-server-core builds the TCP service and UDP service, and is also the basic core module integrating all servers, containing sessions, basic decoding/encoding, basic configuration, and other information
  3. mqtt-broker the MQTT broker and WebSocket service built on Netty

2. Unified Configuration Class and Session Management ​

Integrated base configuration class: NettyConfig

Session management: ISessionStore

3. MQTT & WebSocket Service Startup Class ​

MQTTBootStrap
MQTT & WebSocket service startup class screenshot

4. TCP Service Startup Class ​

TCPBootStrap
TCP service startup class screenshot

5. UDP Service Startup Class ​

UDPBootStrap
UDP service startup class screenshot

6. Locating Server Code for Secondary Development ​

RequirementCheck FirstDescription
MQTT/TCP/UDP start/stopServer configuration, BootStrapConfirm the enabled flag and port configuration
Device session managementISessionStoreUnified management of connection state and sessions
Protocol parsingfastbee-protocolIt is not recommended to write protocol parsing in a Controller
Device authentication/iot/tool/mqtt/auth and other APIsAuthentication logic must keep the product, device, and auth code consistent
Video signalingsip-server, isup-serverTroubleshoot SIP/ISUP separately from the media playback chain
Recording servicefastbee-recordZLM Hook, recording, playback

For more module mappings, see Backend Module Mapping.

FastBee | fastbee.cn