-
-
Notifications
You must be signed in to change notification settings - Fork 664
Expand file tree
/
Copy pathreset_connection.js
More file actions
29 lines (24 loc) · 669 Bytes
/
reset_connection.js
File metadata and controls
29 lines (24 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
const Command = require('./command');
const Packets = require('../packets/index.js');
class ResetConnection extends Command {
constructor(callback) {
super();
this.onResult = callback;
}
start(packet, connection) {
const req = new Packets.ResetConnection();
connection.writePacket(req.toPacket());
return ResetConnection.prototype.resetConnectionResponse;
}
resetConnectionResponse(packet, connection) {
if (connection._statements) {
connection._statements.clear();
}
if (this.onResult) {
process.nextTick(this.onResult.bind(this));
}
return null;
}
}
module.exports = ResetConnection;