Search in sources :

Example 1 with QuitCommandPacket

use of com.alibaba.otter.canal.parse.driver.mysql.packets.client.QuitCommandPacket in project canal by alibaba.

the class MysqlConnector method quit.

public void quit() throws IOException {
    QuitCommandPacket quit = new QuitCommandPacket();
    byte[] cmdBody = quit.toBytes();
    HeaderPacket quitHeader = new HeaderPacket();
    quitHeader.setPacketBodyLength(cmdBody.length);
    quitHeader.setPacketSequenceNumber((byte) 0x00);
    PacketManager.write(channel, new ByteBuffer[] { ByteBuffer.wrap(quitHeader.toBytes()), ByteBuffer.wrap(cmdBody) });
}
Also used : QuitCommandPacket(com.alibaba.otter.canal.parse.driver.mysql.packets.client.QuitCommandPacket) HeaderPacket(com.alibaba.otter.canal.parse.driver.mysql.packets.HeaderPacket)

Aggregations

HeaderPacket (com.alibaba.otter.canal.parse.driver.mysql.packets.HeaderPacket)1 QuitCommandPacket (com.alibaba.otter.canal.parse.driver.mysql.packets.client.QuitCommandPacket)1