javascript - What is byte fixed size length? -
i have connect , send message server. needs message length , manual states:
message length: fixed size (4 bytes)
how fixed length size in javascript/node.js? suppose message is: "hello, hand shake."
use buffer:
var buffer = new buffer(4, 'hex'); buffer.write('aabbaaaa'); // 10101010 10111011 10101010 10101010
docs:
http://nodejs.org/api/buffer.html#buffer_buffer
useful nodejitsu article:
http://docs.nodejitsu.com/articles/advanced/buffers/how-to-use-buffers
Comments
Post a Comment