Search Unity

  1. We have added sub-forums for the experimental MLAPI and Unity Transport Package. Please use the new forums to discuss related topics.
    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:
    637
    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
unityunity