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

Unreliable fragments cause "Packet header indicates non-fragment packet" error #6

Open
zyro opened this issue Oct 23, 2017 · 2 comments

Comments

@zyro
Copy link

zyro commented Oct 23, 2017

When receiving unreliable message fragments an exception is thrown in PacketIO. ReadFragmentHeader.

This seems to work as intended when sending with QoSType.Reliable, but fails with QoSType.Unreliable. Haven't tried QoSType.UnreliableOrdered. Is fragmentation not supported for unreliable packets?

To reproduce:

ReliableEndpoint endpoint1 = new ReliableEndpoint();
ReliableEndpoint endpoint2 = new ReliableEndpoint();

endpoint1.TransmitCallback = (payload, size) =>
{
    endpoint2.ReceivePacket(payload, size);
};
endpoint1.ReceiveCallback = (payload, size) =>
{
    Console.WriteLine("endpoint1 received {0} bytes", size);
};
endpoint2.TransmitCallback = (payload, size) =>
{
    endpoint1.ReceivePacket(payload, size);
};
endpoint2.ReceiveCallback = (payload, size) =>
{
    Console.WriteLine("endpoint2 received {0} bytes", size);
};
            
byte[] data = new byte[5120];
new Random().NextBytes(data);
endpoint1.SendMessage(data, data.Length, QosType.Unreliable);
@GlaireDaggers
Copy link
Owner

Ah, fragmentation is not supported for unreliable fragments, but that does seem like poor failure behavior (ideally, it should be failing with a more descriptive error message when you attempt to send a packet that's too large rather than failing on the receiving end with a somewhat cryptic message like that).

@zyro
Copy link
Author

zyro commented Nov 2, 2017

@KillaMaaki Thanks, I can work with that.

Perhaps as a start the unreliable message channel config should be tweaked to indicate max message size 1024 and max fragments 1 here?

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