Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Questions about Unity Transport 0.3.0-p6

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

  1. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    1,008
    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.

    Thanks.
     
    Last edited: Feb 25, 2020