Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Impero · Feb 09, 2017 at 07:18 PM · networkingsource codechannels

In HLAPI are the ChannelPacket in a reliable ChannelBuffer supposed to be delivered in sequence?

This question might be a bit on the technical side. I have been looking around the source code of the Unity networking HLAPI and I noticed something that confuses me.

If a ChannelBuffer is considered reliable, it uses a Queue to store pending ChannelPackets. These packets are then sent in FIFO order to the NetworkTransport whenever SendInternalBuffer() is called - typically at the end of each frame. That's unless there's room for them to be sent immediately.

I was under the assumption that the use of a Queue structure, was in order to have the packets sent in the sequence they're passed to the ChannelBuffer, but then I noticed the following piece of code in the SendInternalBuffer() method:

 var packet = m_PendingPackets.Dequeue();
 if (!packet.SendToTransport(m_Connection, m_ChannelId))
 {
     m_PendingPackets.Enqueue(packet);
     break;
 }

This code is part of the loop that sends the pending packets to the NetworkTransport. It removes a packet from the beginning of the queue and attempts to send it, if it fails, it add's the packet at the end of the queue. Unless the queue is empty, this enqueue action, messes with the order of the packets, thus breaking my assumption (and breaking the point of having a queue in the first place, I guess).

So my question: Are messages/packets, sent using a reliable Channel, supposed to be sent in sequence?

If this is the case, calling enqueue in the above snippet is a bug.

NOTE: I'm not considering whether the channel is ReliableSequenced or just Reliable, since the ChannelBuffer doesn't have a notion of the specific QOS. It only cares about whether it's reliable or not.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Why does ReliableFragmentedSequenced have a 32 fragment limit? 0 Answers

UNET Setting up a new channel and subsequently message fragmentation 2 Answers

Unity networking tutorial? 6 Answers

RPC ordering details 0 Answers

Why doesn't an object appear on both screens? (Unity networking) 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges