yojimbo87 / OrientDB-NET.binary

C#/.NET binary driver for OrientDB
MIT License
21 stars 19 forks source link

Reading from network stream #36

Open sowee15 opened 10 years ago

sowee15 commented 10 years ago

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!

yojimbo87 commented 10 years ago

Hi, thanks for finding this out. Can you send a pull request please?