Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Packet length limit overflows native socket #49

Open
Alainx277 opened this issue Feb 15, 2022 · 0 comments · May be fixed by #51
Open

Packet length limit overflows native socket #49

Alainx277 opened this issue Feb 15, 2022 · 0 comments · May be fixed by #51

Comments

@Alainx277
Copy link

When communicating a lot of data per frame with a client using a native UDP socket, the following error gets logged:

bevy_networking_turbulence: Receive Error: IoError(Wrapped(Os { code: 10040, kind: Uncategorized, message: "A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself." }))

I think this is caused by the max combined packet size being set to 32768 here:

MuxPacketPool::new(BufferPacketPool::new(SimpleBufferPool(MAX_PACKET_LEN)));

While the receiving naia socket has a fixed buffer size of 1472 (which is close to the minimum reassembly buffer size for IPv6):
https://github.com/naia-rs/naia-socket/blob/6dce8f628aee63997716f6317d9bebc4ddb18375/client/src/impls/native/packet_receiver.rs#L27

I assume this could be fixed by either exposing the option to set the max size, or setting it to the largest size supported by all built-in sockets (which I think is the mentioned 1472).

@Alainx277 Alainx277 linked a pull request Feb 16, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant