docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method PopEventForConnection

    PopEventForConnection(NetworkConnection, out DataStreamReader)

    Pops the next event from the event queue for the given connection, Empty will be returned if there are no more events.

    Declaration
    public NetworkEvent.Type PopEventForConnection(NetworkConnection connection, out DataStreamReader reader)
    Parameters
    Type Name Description
    NetworkConnection connection

    Connection for which to pop the event.

    DataStreamReader reader

    DataStreamReader from which the event data (e.g. payload) can be read from.

    Returns
    Type Description
    NetworkEvent.Type

    The type of the event popped.

    Remarks

    The reader obtained from this method will contain different things for different event types. For Data, it contains the actual received payload. For Disconnect, it contains a single byte identifying the reason for the disconnection (see DisconnectReason). For other event types, it contains nothing.

    PopEventForConnection(NetworkConnection, out DataStreamReader, out NetworkPipeline)

    Pops the next event from the event queue for the given connection, Empty will be returned if there are no more events.

    Declaration
    public NetworkEvent.Type PopEventForConnection(NetworkConnection connection, out DataStreamReader reader, out NetworkPipeline pipe)
    Parameters
    Type Name Description
    NetworkConnection connection

    Connection for which to pop the event.

    DataStreamReader reader

    DataStreamReader from which the event data (e.g. payload) can be read from.

    NetworkPipeline pipe

    Pipeline on which the data event was received.

    Returns
    Type Description
    NetworkEvent.Type

    The type of the event popped.

    Remarks

    The reader obtained from this method will contain different things for different event types. For Data, it contains the actual received payload. For Disconnect, it contains a single byte identifying the reason for the disconnection (see DisconnectReason). For other event types, it contains nothing.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie 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.
    Generated by DocFX on 18 October 2023