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.