I am trying to write a char array to a socket in C++. However, the data I wish to write is raw image data and thus includes ‘\0’, which signals the termination of the string. Is there anyway to send all of the data, including the ‘\0’?
UPDATE: The issue was in the use of strlen(), not write()
The send() function doesn’t care about null bytes. It sends the length you tell it to send.