How to Send Nul to Socket

How would one send a null to the socket.

I am trying to send two byte 0x0039 to the socket as char NUL & 9.

So, I am trying:
MBS( "Socket.WriteByte"; $sock; 0 )
MBS("Socket.Write"; $sock; "9")

...but all I get on the tcpdump is hex 39 when I should get hex 0039 (and in the ascii portion "9")

Any thoughts?

Sorry. This should work. Can you try

MBS( "Socket.WriteHex"; $sock; "0039" )

to send it together?

And is that macOS, Windows or Linux?

MBS("Socket.WriteHex";$sock;$data) did the trick. What I did not recognize was that MBS("Socket.WriteByte";$sock;0) was actually writing the byte... but in a separate packet.

So... I first converted all the $data to hex and then used WriteHex.

Thanks you.

Yes, it may be good to send everything in one packet.