File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 3
3
<description >php-mqtt Code Style Standard</description >
4
4
5
5
<rule ref =" PSR1" />
6
+ <rule ref =" PSR1.Methods.CamelCapsMethodName.NotCamelCaps" >
7
+ <exclude-pattern >tests/*</exclude-pattern >
8
+ </rule >
6
9
<rule ref =" PSR2" >
7
10
<exclude name =" PSR2.Methods.MethodDeclaration.AbstractAfterVisibility" />
8
11
<exclude name =" Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis" />
Original file line number Diff line number Diff line change @@ -991,6 +991,8 @@ protected function handlePublishReceipt(string $buffer): void
991
991
'The MQTT broker sent a receipt for a publish that has not been pending anymore. '
992
992
);
993
993
}
994
+
995
+ $ this ->sendPublishRelease ($ messageId );
994
996
}
995
997
996
998
/**
@@ -1272,6 +1274,23 @@ protected function sendPublishReceived(int $messageId): void
1272
1274
$ this ->writeToSocket (chr (0x50 ) . chr (0x02 ) . $ this ->encodeMessageId ($ messageId ));
1273
1275
}
1274
1276
1277
+ /**
1278
+ * Sends a publish release message for the given message identifier.
1279
+ *
1280
+ * @param int $messageId
1281
+ * @return void
1282
+ * @throws DataTransferException
1283
+ */
1284
+ protected function sendPublishRelease (int $ messageId ): void
1285
+ {
1286
+ $ this ->logger ->debug ('Sending publish release message to an MQTT broker. ' , [
1287
+ 'broker ' => sprintf ('%s:%s ' , $ this ->host , $ this ->port ),
1288
+ 'message_id ' => $ messageId ,
1289
+ ]);
1290
+
1291
+ $ this ->writeToSocket (chr (0x62 ) . chr (0x02 ) . $ this ->encodeMessageId ($ messageId ));
1292
+ }
1293
+
1275
1294
/**
1276
1295
* Sends a publish complete message for the given message identifier.
1277
1296
*
You can’t perform that action at this time.
0 commit comments