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

Fails on large software #26

Open
Yuri6037 opened this issue Apr 26, 2022 · 1 comment
Open

Fails on large software #26

Yuri6037 opened this issue Apr 26, 2022 · 1 comment

Comments

@Yuri6037
Copy link

I have a large client-server software where the messages are encoded and decoded through bincode and may contain a bunch of strings, integers, floats, etc.

I recently tried to move to tokio which simplifies and fixes portability bugs (random os error 35 on macOS for example). To move the code I've used tokio-serde to support deserializing the packets serialize through bincode. Unfortunately, every-time a packet contains a bunch of strings tokio-serde errors with "frame size too big".

Is there any workaround to this bug?

@WeaponMan
Copy link

WeaponMan commented Aug 14, 2022

If you using LengthDelimitedCodec then default value of max_frame_length is 8MB so everything above 8MB in size will get rejected with that message.

Use LengthDelimitedCodec::builder() and set your desired max_frame_length on it, like so:

  let len_codec = LengthDelimitedCodec::builder()
      .max_frame_length(8 * 1024 * 1024) // 8MB
      .new_codec();

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