Closed GoogleCodeExporter closed 9 years ago
The error is shown in NetBitWriter line 45
Original comment by jethro0...@gmail.com
on 18 Oct 2013 at 2:36
Most likely unmatched read/writes
Original comment by lidg...@gmail.com
on 13 Jan 2014 at 8:35
This question is a bit old, but I made my way to here from Google. So, like me,
some ppl may find it while looking a solution to this same issue.
Well, I just figured out what was wrong on my code:
I was using a message.ReadString() twice, while the client had used
message.Write(string) only once. Remember that everytime you do the
Write(Value) operation, a new index will be added to the array buffer, so if
you do ReadString() twice, the program will look for the first string, then for
the second string, which will not exist in the array. That's why you get the
"our of range" exception sometimes.
Also, if you wrote anInt32 (for example), make sure to read an Int32, or the
read and writes won't match, as someone posted above.
Original comment by fr92...@gmail.com
on 19 Jan 2014 at 4:41
Original issue reported on code.google.com by
jethro0...@gmail.com
on 18 Oct 2013 at 2:33