Dear all, the below code is how am returning a tcp message to a client machine, but the company demanded i should be adding a tcp/ip header to the message. They said the header should be a 2-byte header prefixed which will indicate the length on the TCP/IP stream. can anybody help me on how i can include the header on the below code
private static void Send(Socket handler, String data)
{
// Convert the string data to byte data using ASCII encoding.
byte[] byteData = Encoding.ASCII.GetBytes(data);
// Begin sending the data to the remote device.
handler.BeginSend(byteData, 0, byteData.Length, 0, new AsyncCallback(SendCallback), handler);
}