Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Questions about Unity Transport 0.3.0-p6

Discussion in 'Unity Transport' started by Kichang-Kim, Feb 25, 2020.

  1. Kichang-Kim


    Oct 19, 2010
    Hi. I found that Unity Transport 0.3.0-p6 has lots of changes, especially for Pipelines.

    1. Why all pipeline buffers are aligned with 8 bytes?
    In previous version, buffer sizes are calculated by simple summation of needed type size, but 0.3.0-p6 align all of buffers by 8 byte (NetworkPipelineProcessor.Alignment). Is this need for Burst compatible? or any other reasons?

    Also, NetworkPipelineProcessor is internal type and custom pipeline can't use its Alignement field. Is this intended?

    2. Error handling for initialization failed
    In internal pipeline source code, InitializeConnection methods simply do nothing when input buffer size is not sufficient. Is there any method for catching initialization failed? with previous version, I simply throw Exception(), but new implementation uses Burst Function Pointer, so I doubt that throwing execption is safe.

    3. Receive/Send inbound buffer
    In prev, that buffers has 2 type field, buffer1 and buffer2. But new InboundRecvBuffer and InboundSendBuffer has single buffer. Can I use single buffer as sum of buffer1 and buffer2?

    Also, what different between InboundSendBuffer.bufferWithHeaders and InboundSendBuffer.buffer? It seems that when creating or update existing InboundSendBuffer, need to call SetBufferFrombufferWithHeaders(). So I thinkt that I should set bufferWithHeaders for sending custom data. But how about NetworkPipelineContext.header? should I set header data to this or to bufferWithHeaders?

    In ReliablePipeline sourcecode, it seems that setting data without pipeline header to bufferWithHeaders, so it is very confusing.

    Last edited: Feb 25, 2020