Possible MessageBuffer issues?

Nov 12, 2009 at 8:35 PM
Edited Nov 12, 2009 at 9:24 PM

So far so great! Bumped up my timer to tick at 100ms to simulate near-realtime and I'm getting an interesting error from the JSON serializer. The error is that the serializer doesn't like the input from the stream but I have confirmed that its ok.

My hunch is that the messageBuffer in the MessageClient class is not synchronzied and  as such is being modified as its being read into the serializer.




So I went ahead and synchronized access to this buffer and problem still exists. Still searching...

Aug 22, 2010 at 12:53 PM

2 things so far I have come up with the json serializer/deserializer

1) if you were to send a double number from a system that has a "," (comma) as floating point operator in it's current culture, the json data "becomes corrupted". you can either set a default culture to be used for the execution or format  the number so no comma will be included in the json string..

2) since you don't know the size of the json string that is sent over the stream, if you send a json string with size > current buffer size, the data is truncated however the data is started to be deserialized as soon as the first packet arrives.. you can either increase the buffer size to avoid it, or wait until the buffer is completed or send the size of the json string ahead of the json string ( :S ) so you can compare what you have with what should be..

Sep 22, 2010 at 4:50 PM

I confirmed that the message is being truncated.

Do you have any code to help out? I am now using the binary serializer.

Your help would be greatly appreciated.