Search in sources :

Example 1 with NIOConnection

use of io.mycat.net.NIOConnection in project Mycat-Server by MyCATApache.

the class KillConnection method response.

public static void response(String stmt, int offset, ManagerConnection mc) {
    int count = 0;
    List<FrontendConnection> list = getList(stmt, offset, mc);
    if (list != null) {
        for (NIOConnection c : list) {
            StringBuilder s = new StringBuilder();
            logger.warn(s.append(c).append("killed by manager").toString());
            c.close("kill by manager");
            count++;
        }
    }
    OkPacket packet = new OkPacket();
    packet.packetId = 1;
    packet.affectedRows = count;
    packet.serverStatus = 2;
    packet.write(mc);
}
Also used : FrontendConnection(io.mycat.net.FrontendConnection) OkPacket(io.mycat.net.mysql.OkPacket) NIOConnection(io.mycat.net.NIOConnection)

Aggregations

FrontendConnection (io.mycat.net.FrontendConnection)1 NIOConnection (io.mycat.net.NIOConnection)1 OkPacket (io.mycat.net.mysql.OkPacket)1