类型 | 名字 | 描述 |
---|---|---|
int3> | payload长度 | 按照the least significant byte first存储,3个字节的payload和1个字节的序列号组合成报文头 |
int1> | 序列号 | |
string | payload | 报文体,长度即为前面指定的payload长度 |
ping命令包
Payload
[0e] COM_PING
更多详情 : http://dev.mysql.com/doc/internals/en/com-ping.html
ping命令包类
/** * * @author seaboat * @date 2016-09-25 * @version 1.0 * pre>b>email: /b>849586227@qq.com/pre> * pre>b>blog: /b>http://blog.csdn.net/wangyangzhizhou/pre> * p>ping command packet./p> */ public class PingPacket extends MySQLPacket { // payload length is 1,packet id is 0,payload is 0e public static final byte[] PING = new byte[] { 1, 0, 0, 0, 14 }; @Override public int calcPacketSize() { return 1; } @Override protected String getPacketInfo() { return "MySQL Ping Packet"; } }
源码下载:http://xiazai.jb51.net/201701/yuanma/mysql-protocol-master(jb51.net).rar
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!