Skip to content

Commit 0333613

Browse files
committed
Merge pull request brianc#645 from jeromew/patch-1
Add Close/CloseComplete messages of wire protocol
2 parents f0d91e7 + aada94d commit 0333613

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/connection.js

Lines changed: 8 additions & 0 deletions
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)