Send byte array in node.js to server

前端 未结 2 1382
南方客
南方客 2021-02-13 20:20

I can\'t figure out to send byte array while being connected to server on Debian. Is there any alternative to sending string via client.write()? I tried clien

2条回答
  •  时光说笑
    2021-02-13 20:54

    Buffer didn't work for me because I had a custom class named exactly as node.js's one. This works:

    testBuff = new Buffer([4, 0, -1, 1, 32, 0]);
    client.write(testBuff);
    

提交回复
热议问题