Skip to content

Commit aada94d

Browse files
committed
Add Close/CloseComplete messages of wire protocol
1 parent f0d91e7 commit aada94d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/connection.js

+8
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ Connection.prototype.end = function() {
300300
this._send(0x58);
301301
};
302302

303+
Connection.prototype.close = function(msg, more) {
304+
this.writer.addCString(msg.type + (msg.name || ''));
305+
this._send(0x43, more);
306+
};
307+
303308
Connection.prototype.describe = function(msg, more) {
304309
this.writer.addCString(msg.type + (msg.name || ''));
305310
this._send(0x44, more);
@@ -364,6 +369,9 @@ Connection.prototype.parseMessage = function(buffer) {
364369
case 0x32: //2
365370
return new Message('bindComplete', length);
366371

372+
case 0x33: //3
373+
return new Message('closeComplete', length);
374+
367375
case 0x41: //A
368376
return this.parseA(buffer, length);
369377

0 commit comments

Comments
 (0)