-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem in converting string into JSON; Can't parse successfully. #1854
Comments
You should put your description into the comment/description field, not in the subject, it is unreadable. |
I'm receiving Json string from TCP protocol. I get some packets perfect but then I get an error The string I want is here in the char "buf" I receive few Json perfect. Then I get the error I mentioned above. I'm a newbie to c++ and to raspberry pi. Any help will be really appreciated. |
What is the exception saying? |
I tried catching the exception, but it gives me error So I'm receiving 3 jason continuously one after the other, I receive few but it gives me this error in the middle of the 5th or 6th packet I don't know why it doesn't wait till it finds the close bracket '}'. I don't know if it has to do something with the size of the buffer where I receive the tcpip,
Sorry if I'm not clear explaining. Thank you for the quick response. |
It has nothing to do with the size of the buffer. The longest json I have is less than 4096. Also I didn't mention is I'm getting ton of warnings, This is the first one, /usr/include/c++/8/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool, long long int, long long unsigned int, double, std::allocator, nlohmann::adl_serializer>}; _Tp = nlohmann::basic_jso n<>; _Alloc = std::allocator<nlohmann::basic_json<> >]’: |
@nlohmann You can close this issue. I think the problem is I'm not able to receive a complete string from my application through tcpip after few successful json strings. If I ignore that one incomplete json string my program works fine. I don't think it has anything to do with your library. It works perfect ones I get a complete json string to process. Thank you for your response. |
What is the issue you have?
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
What is the expected behavior?
And what is the actual behavior instead?
Which compiler and operating system are you using? Is it a supported compiler?
Did you use a released version of the library or the version from the
develop
branch?If you experience a compilation error: can you compile and run the unit tests?
The text was updated successfully, but these errors were encountered: