View Single Post
  #1 (permalink)  
Old August 28th, 2006, 03:04 PM
michaelqonly michaelqonly is offline
Registered User
Join Date: Aug 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chaper29, Exercise2 doesn't work

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:
                    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.

Reply With Quote