diff --git a/lib/frame.js b/lib/frame.js index 65f0fd5..dea5b5f 100644 --- a/lib/frame.js +++ b/lib/frame.js @@ -29,12 +29,11 @@ StompFrame.prototype.send = function(stream) { } } frame += '\n'; + stream.write(frame); if (this.body.length > 0) { - frame += this.body; + stream.write(this.body); } - frame += '\0'; - if(frame) - stream.write(frame); + stream.write('\0'); }; StompFrame.prototype.setCommand = function(command) {