broker/test/MQTTWebSocket: code formatter used
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
*
|
||||
* You may elect to redistribute this code under either of these licenses.
|
||||
*/
|
||||
|
||||
package io.moquette.server;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -58,28 +59,27 @@ public class MQTTWebSocket {
|
||||
LOG.info("Got connect: %s%n", session);
|
||||
this.session = session;
|
||||
|
||||
//Trivial MQTT Connect message
|
||||
// assertEquals(12, out.readByte()); //remaining length
|
||||
// verifyString("MQIsdp", out);
|
||||
// assertEquals(0x03, out.readByte()); //protocol version
|
||||
// assertEquals(0x32, out.readByte()); //flags
|
||||
// assertEquals(2, out.readByte()); //keepAliveTimer msb
|
||||
// assertEquals(0, out.readByte()); //keepAliveTimer lsb
|
||||
// Trivial MQTT Connect message
|
||||
// assertEquals(12, out.readByte()); //remaining length
|
||||
// verifyString("MQIsdp", out);
|
||||
// assertEquals(0x03, out.readByte()); //protocol version
|
||||
// assertEquals(0x32, out.readByte()); //flags
|
||||
// assertEquals(2, out.readByte()); //keepAliveTimer msb
|
||||
// assertEquals(0, out.readByte()); //keepAliveTimer lsb
|
||||
|
||||
ByteBuffer msg = ByteBuffer.wrap(new byte[] { 0x10, //message type
|
||||
0x0C, //remaining lenght 12 bytes
|
||||
'M', 'Q','I','s','d','p',
|
||||
0x03, //protocol version
|
||||
0x32, //flags
|
||||
0x02, 0x00// keepAlive Timer, 2 seconds
|
||||
ByteBuffer msg = ByteBuffer.wrap(new byte[]{0x10, // message type
|
||||
0x0C, // remaining lenght 12 bytes
|
||||
'M', 'Q', 'I', 's', 'd', 'p', 0x03, // protocol version
|
||||
0x32, // flags
|
||||
0x02, 0x00// keepAlive Timer, 2 seconds
|
||||
});
|
||||
// try {
|
||||
session.getRemote().sendBytes(msg);
|
||||
this.connectSentLatch.countDown();
|
||||
session.close(StatusCode.NORMAL, "I'm done");
|
||||
// } catch (IOException t) {
|
||||
// LOG.error(null, t);
|
||||
// }
|
||||
// try {
|
||||
session.getRemote().sendBytes(msg);
|
||||
this.connectSentLatch.countDown();
|
||||
session.close(StatusCode.NORMAL, "I'm done");
|
||||
// } catch (IOException t) {
|
||||
// LOG.error(null, t);
|
||||
// }
|
||||
}
|
||||
|
||||
public boolean awaitConnected(int duration, TimeUnit unit) throws InterruptedException {
|
||||
|
||||
Reference in New Issue
Block a user