|
-
Nov 7th, 2003, 02:13 PM
#2
There are really two approaches to take here:
1: Terminate every message with a special character, like a newline. Read the buffer until you reach this character; parse the results, and then continue until the buffer is empty or until it doesn't end with the special character.
2: Make the first two/four bytes of every message the message length. Read that many bytes from the buffer, parse the message, and then repeat until there are less than that number of bytes in the buffer, or the buffer is empty.
Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|