2011-12-01, 13:42
For streaming parsing check YAJL (or YAJL-py for the python version). it does add some complexity with parsing but such will always be the case with streaming data as the raw TCP is. So with YAJL-Py you would count the object start/ends and when you reach 0 on end you know you have one package. You could do the actual parsing in the SAX handlers or simply store the string you input and do the parsing when you have deduced when the package is finished (the former is the better). For those understanding C++ you can look at our streaming parsers in XBMC, (https://github.com/xbmc/xbmc/blob/master...Parser.cpp)
The fact is that \n checking which some others relied on previously was equally error prone as its as valid to have \n within a json object as } is in strings
The fact is that \n checking which some others relied on previously was equally error prone as its as valid to have \n within a json object as } is in strings