Network penetration/dynamic networking/video cloud gateway EasyNTS networking platform how to detect whether the MQTT port is occupied?

MQTT (Message Queue Telemetry Transmission) is a message protocol based on the publish/subscribe paradigm under the ISO standard (ISO/IEC PRF 20922). It works on the TCP/IP protocol suite and is a publish/subscribe message protocol designed for remote devices with single hardware performance and poor network conditions.

EasyNTS architecture diagram 12.5D.png

In the actual EasyNTS deployment scenario, because we cannot know which ports on the deployment site are in use, we cannot access EasyNTS. It often happens that EasyNTS cannot be started after accessing the ports. The system does not prompt any port exception reminder, and the service cannot be accessed.

297.png

Therefore, it is necessary for us to check the occupancy of the port when opening the MQTT service of EasyNTS, and the occupancy will be prompted on the command line.

We added the following code when compiling the system. When the project is started, the MQTT port will be tested for the local port. If it is occupied, an error message will be displayed.

//检测mq端口占用情况
if esys.IsPortInUse(int(esys.IniConf().MqttPort)) {
   err := fmt.Errorf("EasyNTS MQTT port[%v] In Use", esys.IniConf().MqttPort)
   return err
}

The photo prompt in the command line after the resolution:

298.png

In this way, we can avoid the situation that we use the occupied port and cause the program to fail to run, reduce the error rate of system operation, and improve the efficiency of deployment.

The normal running system is shown below:

NTS4.png

EasyNTS Cloud Gateway realizes the functions of equipment access and control, dynamic networking, remote operation and maintenance, file transmission, and remote command invocation. From the terminal to the cloud, it forms a complete set of cloud gateway solutions, which greatly solves the scene No fixed IP, unopened ports, unopened system permissions, etc. For more video-related solutions, you can visit TSINGSEE Green Rhinoceros Video . Welcome to contact us for a demonstration program, intuitive experience, or download and test by yourself .


EasyDarwin open source streaming media server is an open source streaming media platform framework developed and maintained by the domestic open source streaming media team TSINGSEE Qingxi Video. Since its creation and development in December 2012, it has expanded from the original single-service streaming media server form to the current open source project of the cloud platform architecture.

Guess you like

Origin blog.csdn.net/EasyNTS/article/details/108736886