Write hex to net socket

Posted on
  • I'm probably missing something stupendously obvious, but I need to write raw hex values to a net socket.

    I've tried sckt.write([0xFF], 'hex'), but I receive ASCII encoded data at the far end.

    Also tried sckt.write('FF'), sckt.write('0xFF'), constructing a Uint8Array and sending that, but no matter what I do I just get ascii data.

  • Thanks for the link! I did update the docs previously, but they'll only go online when 1v93 is released I'm afraid!

    Another option is to just use an escape sequence in a string: sckt.write("\xFF")

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Write hex to net socket

Posted by Avatar for dave_irvine @dave_irvine