I experienced a problem with certain queries where the stream read from the network was not complete. I think there's a problem with the way you read from the network stream. You're relying on stream.DataAvailable to stop reading from the stream. However, this property indicates if there's something to read at that time, not if the server is done sending data. I fixed the problem by parsing the message sent from the server using your current parsing algorithm, but instead of working on the buffer array, I work directly on the network stream using the sets of methods on BinaryReader. So I stop reading from the stream when the flag in the data indicates that there's nothing else to read.
Hi,
I experienced a problem with certain queries where the stream read from the network was not complete. I think there's a problem with the way you read from the network stream. You're relying on stream.DataAvailable to stop reading from the stream. However, this property indicates if there's something to read at that time, not if the server is done sending data. I fixed the problem by parsing the message sent from the server using your current parsing algorithm, but instead of working on the buffer array, I work directly on the network stream using the sets of methods on BinaryReader. So I stop reading from the stream when the flag in the data indicates that there's nothing else to read.
Let me know if you would like more information.
Thanks!