Mosquitto官网:http://mosquitto.org/
MQTT协议:http://mqtt.org/
1403334375: New connection from 121.201.8.163 on port 1883.
1403334375: New client connected from 121.201.8.163 as zhoujing (c0, k60, ujoyo).
1403334375: Sending CONNACK to zhoujing (0)
以上是一个客户端正常连接的日志。
1403334375: 表示连接的时间点
121.201.8.163: 客户端的IP地址
1883: 连接的服务器端口号
zhoujing (c0, k60, ujoyo): 客户端连接指定的ClientID为'zhoujing'
c0: 表示cleanSession=false,不清除session
k60: 表示keep-alive=60s
ujoyo: 表示使用的服务器账号为joyo
1403334375: Received SUBSCRIBE from zhoujing
1403334375: jiji/chat/9 (QoS 2)
1403334375: zhoujing 2 jiji/chat/9
1403334375: Sending SUBACK to zhoujing
1403334378: Sending PUBLISH to zhoujing (d0, q2, r0, m1, 'jiji/chat/9', ... (396 bytes))
1403334378: Received PUBREC from zhoujing (Mid: 1)
1403334378: Sending PUBREL to zhoujing (Mid: 1)
1403334378: Received PUBCOMP from zhoujing (Mid: 1)
(d0, q2, r0, m1)的解释, 以下参数具体含义,参考MQTT协议
d: 表示mqtt报头的DUP字段
q: 表示的QOS字段
r: 表示的是RETAIN
m: 表示的是消息ID,即mid
客户端主动断开连接的只有一行日志,很简单。如下所示:
1403334380: Received DISCONNECT from JY_API_PUSH_CLIENT
1403334389: Received PUBLISH from JY_API_PUSH_CLIENT (d0, q2, r0, m1, 'jiji/chat/9', ... (396 bytes))
1403334389: Sending PUBREC to JY_API_PUSH_CLIENT (Mid: 1)
1403334389: Received PUBREL from JY_API_PUSH_CLIENT (Mid: 1)
1403334389: Sending PUBCOMP to JY_API_PUSH_CLIENT (Mid: 1)
1403334510: New connection from 121.201.7.150 on port 1883.
1403334510: Client JY_API_PUSH_CLIENT already connected, closing old connection.
1403336716: Received PINGREQ from 36383A64663A6464003V0
1403336716: Sending PINGRESP to 36383A64663A6464003V0
1403336671: Client 33303A33393A3236003V0 has exceeded timeout, disconnecting.
1403337602: Socket error on client 351BBJKFX62C1, disconnecting.
1403337602: Socket error on client 351BBJKFX62C0, disconnecting.