Skip to content

Instantly share code, notes, and snippets.

@phillro
Created October 12, 2012 07:43
Show Gist options
  • Save phillro/3877832 to your computer and use it in GitHub Desktop.
Save phillro/3877832 to your computer and use it in GitHub Desktop.
pub cmd
conn.send(" V2");
var cmd = new Buffer("PUB test\n");
var body = new Buffer('hello world.');
var size = new Buffer(4)
size.writeInt16BE(body.length,0)
var msg = Buffer.concat([cmd, body,size]);
conn.send(msg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment