Sending bytes issue
843841Feb 19 2007 — edited Feb 20 2007Hi
I am implementing an echo server and a client to measure RTT and throughput of a TCP link. I have been provided with a detailed protocol the server and client must follow.
Here is the problem:
The server at a certain point will be waiting for the client to send data in the following format <'m'><space><sequence #><space><payload>. The payload will have to be either 1, 100, 200, 400, 800, and 1000 Bytes.
Since I've implemented the server and the client both to read and write strings/characters to each other, I dont know how to send and receive the payload part of the message with a desired size.
Any idea how I can send and parse a desired number of bytes in/from a message (a string message)??
Although I know that a character is encoded as 2 bytes, but what do I do about this 1 byte? would I need to recode my client and server to work with byte streams?
Thanks
Message was edited by:
eXKoR