Skip to content
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

RPC requires framed option? #20

Open
battlmonstr opened this issue Aug 2, 2017 · 2 comments
Open

RPC requires framed option? #20

battlmonstr opened this issue Aug 2, 2017 · 2 comments

Comments

@battlmonstr
Copy link

The checkReadBuffer function of MPMessagePackClient willl stop parsing a big message with an error on this line of code:

[self handleError:error fatal:YES];

This function tries to parse _readBuffer, which is filled from the stream by portions using a smaller buffer here:

uint8_t buffer[4096];

This happens in 2 cases:

  • either the complete message is bigger than the smaller buffer size (4096 bytes)
  • or the network is slow to load just a part of the message in one read call (let's say your message is 2K, but the network provides only the first 1K in the beginning)

I'd prefer that this RPC client was tolerant to the errors that happen due to the buffer index outrun, and just retried readInputStream in this case.

@gabriel
Copy link
Owner

gabriel commented Aug 10, 2017

I think the framed option allows it to know ahead of time how big the message is and in that case will wait for it?

@gabriel
Copy link
Owner

gabriel commented Aug 10, 2017

I always use the framed option with the RPC, so it's possible non-framed doesn't work with RPC. I'd probably need to look into it further.

@gabriel gabriel changed the title big RPC message parse error RPC requires framed option? Aug 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants