I’m trying to send the Length of a Byte array to my server, so that it knows how much data to read.
I get the length of the Byte[] message array using int messageLength = message.Length
How do I represent this integer messageLength a four-byte integer?
Use BitConvertor
BitConverter.GetBytes(message.Length);