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

fixed the udp hello connection message drop on azure environment #172

Conversation

kapitanmliko
Copy link
Contributor

To avoid the udp "connection acknowledgment/hello" message being dropped. I increased the size of the message buffer from 8 to 12 bytes. The message content is the same as before and remaining 4 bytes are simply ignored.

Linked to the issue #171

}

bool failedUdpReceive = receivedUdp != udpAcknowledgmentSize;
if (!failedUdpReceive)
{
if (protocolVersion != 0)
{
for (int i = 0; i < udpAcknowledgmentSize; ++i)
for (int i = 1; i < buffer.Length; i++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of the point of these changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the lenght of the the buffer is 9 and the udpAcknowledmentSize is now 12 so I had to modify this loop so it does not end out of bounds of the buffer array. ++i and i++ should do the same thing inside forloop afaik and for the sake of consistency with the larger side of the code base I have chosen i++.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be a good idea to keep them both to be of same size? I just wanted to modify as little as possible. I would leave the rest to someone more competent

@JamJar00
Copy link
Member

JamJar00 commented Dec 30, 2022

Looks pretty reasonable, since we haven't yet released these changes yet I'm happy with the change in size.

I think the Unordinal team are using Azure so would be good if they can test this out to verify!

For future reference it looks like your IDE is reformatting code (namely the number of spaces before a comment), that gets annoying for reviewers 🙂

@kapitanmliko
Copy link
Contributor Author

kapitanmliko commented Dec 30, 2022

Yes... I have noticed that... it's imo because it's inconsistent throughout the code... sometimes it's oneway sometimes the other. It did not modify it everywhere. I had also similar problem with the placement of the "{" at the beginning of the method block as it's sometimes at same line with the declaration and sometimes on new line... I reverted those because that was reasonably doable. I am sorry about that. Thank you for your comments.

@4real
Copy link
Contributor

4real commented Jan 19, 2023

I'm in favor of merging once tests pass.

@4real
Copy link
Contributor

4real commented Jan 19, 2023

Added test fixes to #175 (which contains your commit, so you will be properly credited afaik)

@4real 4real closed this Jan 19, 2023
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

Successfully merging this pull request may close these issues.

3 participants