Subject: Chaper29, Exercise2 doesn't work
Posted By: michaelqonly Post Date: 8/28/2006 3:04:13 PM
The source code for exercise 2 of Chaper29 networking can compile, however, couldn't run. Every time when I run it, the application is frozen.

Given error message for the code in server side:
do
                {
                    readBytes = clientStream.Read(buffer, 0, bufferSize);
                    memStream.Write(buffer, offset, readBytes);
                    offset += readBytes;
                } while (readBytes > 0);

The following is the error message:

Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.

If anyone knows how to fix it, please help.
Many thanks in advance.


Go to topic 48758

Return to index page 191
Return to index page 190
Return to index page 189
Return to index page 188
Return to index page 187
Return to index page 186
Return to index page 185
Return to index page 184
Return to index page 183
Return to index page 182