Skip to content

Handling pingrequests #17

@kappsegla

Description

@kappsegla

Problem Description

A connected client can send a PINGREQ and get a PINGRESP back to make sure the connection is alive.

PINGREQ
PINGRESP

if (buffer[0] == (byte) 0xC0) {
                    System.out.println("Received MQTT PINGREQ message from client");
                    byte[] pingrespMessage = new byte[]{(byte) 0xD0, (byte) 0x00};
                    outputStream.write(pingrespMessage);
                    outputStream.flush();
                    System.out.println("Sent MQTT PINGRESP message to client");

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions