Post 21 made on Tuesday December 21, 2010 at 11:35 |
Barry Gordon Founding Member |
Joined: Posts: | August 2001 2,157 |
|
|
If I unerstand you correctly, What you really want is the string in memory to end in a byte that has the decimal value of 31. Lets call everything up to that point FrontOfString which is of type string.
Desired string=FrontOfString+string.fromCharCode(31).
In your specific case :
sock.write("\x00\x00\x00\x00\x00\x05\x00\x10\x00\x05\x00\x01\x02\x00"+string.fromCharCode(31));
or
sock.write(string.fromCharCode(0,0,0,0,0,5,0,16,0,5,0,1,2,0,31))
The last technique being much easier IMHO
|
|
|