Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

How to tcp/ip header

$
0
0

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);
	}


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>