Download the PHP package markkimsal/amphp-mqtt without Composer
On this page you can find all versions of the php package markkimsal/amphp-mqtt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package amphp-mqtt
MQTT
markkimsal/amphp-mqtt
is an asynchronous MQTT client for PHP based on Amp.
Installation
This project does not require any PHP extensions.
Usage
Every publish or subscribe returns an Amp\Promise
that you can react to when it's resolved. Messages are received from ->on('message')
and that takes a callback with only 1 argument: the Packet\Publish
class. Packet\Publish
is used for both sending and receiving messages.
You can start sending and subscribing before the connection ack packet is received and the system will queue up your packets but still return a Amp\Promise
immediately.
QoS 0 packets will resolve as soon as they are sent as they will not get any acknowledgement from the server.
QoS 1 packets will resolve when the client gets a Puback packet.
QoS 2 packets will resolve when the client gets a Pubcomp packet. The client will automatically respond to Pubrec with a Pubrel as per the spec.
Supports TLSv1.2 by using "tls://" prefix to the URI of the server. Peer verification is not done.
Supports username and password authentication as parameters of the connection URL.
Blocking mode (integration with sync code)
You can use this library in a synchronous backend to wait for sending packets with QoS 0,1, or 2.
Manual Publish Acking
You can control when you acknowlege publish messages of QoS 1 and 2 by disabling the auto-ack feature.
Otherwise, the appropriate acknowledgement packets will be sent after the on('message')
handler is run.
Clean Session
You can connect with a clean session by adding cleanSession
as a URL parameter.
You MUST either use a clean session or supply a client ID.
If you do not supply a clientId a clean session is automatically created for you.
All versions of amphp-mqtt with dependencies
amphp/amp Version ^2
amphp/socket Version ^0.10
amphp/uri Version ^0.1