Merge pull request #645 from jeromew/patch-1

Add Close/CloseComplete messages of wire protocol
This commit is contained in:
Brian C 2014-09-18 15:30:27 -04:00
commit 03336139ef

View File

@ -300,6 +300,11 @@ Connection.prototype.end = function() {
this._send(0x58);
};
Connection.prototype.close = function(msg, more) {
this.writer.addCString(msg.type + (msg.name || ''));
this._send(0x43, more);
};
Connection.prototype.describe = function(msg, more) {
this.writer.addCString(msg.type + (msg.name || ''));
this._send(0x44, more);
@ -364,6 +369,9 @@ Connection.prototype.parseMessage = function(buffer) {
case 0x32: //2
return new Message('bindComplete', length);
case 0x33: //3
return new Message('closeComplete', length);
case 0x41: //A
return this.parseA(buffer, length);