This code doesn't send the trailing null byte. How do I send the trailing null?
Socket.writeUTFBytes('Hello World');
Socket.flush();
Thanks in advance. :)
This code doesn't send the trailing null byte. How do I send the trailing null?
Socket.writeUTFBytes('Hello World');
Socket.flush();
Thanks in advance. :)
I'm not certain how to attach it to the end of a string literal. But you can always do:
Socket.writeByte(0);
use writeByte
.
socket.writeUTFBytes('Hello World');
socket.writeByte(0);
socket.flush();
Have you tried:
Socket.writeUTFBytes('Hello World\0');
Socket.flush();