Simps / mqtt v1.1.2 is the first PHP library to support mqtt V5.0 protocol

Time:2021-3-2

The auth type is supported in this version and the attributes not supported in the previous version, which also means that the protocol of mqtt V5.0 has been supported, and the bug repair and code optimization are left in the later version

Most scenarios are verified directly at connect, so the auth type is not used

Because the auth type has no suitable scenario for testing, if you encounter problems in use, you can give me feedback

At the same time, the user-defined timeout configuration item is removed, and the configuration item provided by swoole is used directly, which can be directly set in the second parameter of the client, such as:

$swooleConfig = [
    'open_mqtt_protocol' => true,
    'package_max_length' => 2 * 1024 * 1024,
    'timeout '= > 0.5, // total timeout, including all timeouts of connection, sending and receiving
    'connect_ Timeout '= > 1.0, // if the connection times out, the first total timeout will be covered
    'write_ Timeout '= > 5.0, // the sending timeout will cover the first total timeout
    'read_ Timeout '= > 0.5, // receive timeout, the first total timeout will be covered
];

$client = new Simps\MQTT\Client($config, $swooleConfig);

Update log

enhance

  • Support auth type (8478e48) (5c5e031)
  • Add QoS rationphases (16f28aa)
  • Add auth method of client (84bf394)
  • Add unit test (# 18)
  • Add type declaration (# 19)
  • Optimize duplicate code (# 20) (7868504)

repair

  • Fix mqtt v5.0 suback type error (f06d0c9)

remove

  • Remove the custom timeout configuration item (# 21)

On Sims / mqtt

It is the first PHP library to support mqtt V5.0 protocol

It also supports mqtt protocol versions 3.1, 3.1.1 and 5.0, and supports QoS 0, QoS 1 and QoS 2

GitHub:https://github.com/simps/mqttPoint star to support us

file:https://mqtt.simps.io

Simps / mqtt v1.1.2 is the first PHP library to support mqtt V5.0 protocol