docs.unity3d.com
    Show / Hide Table of Contents

    Enum NetworkEvent.Type

    Types of network events that can be returned by PopEvent(out NetworkConnection, out DataStreamReader).

    Namespace: Unity.Networking.Transport
    Syntax
    public enum Type : short

    Fields

    Name Description Value
    Empty

    No event. Returned when there are no more events to pop.


    0
    Data

    A message was received on the connection. The contents of the message can be read from the DataStreamReader that was returned along with the event. Furthermore, the pipeline on which the message was received will also be returned (for the variants of PopEvent that return it).


    1
    Connect

    Connection has been successfully established. From this point on it's okay to send data on the connection. Returned after calling Connect(NetworkEndpoint) when the connection was successful. Note that servers do not get this event (new connections are notified through the Accept() call).


    2
    Disconnect

    Connection has been closed, or has failed to be established. The reason for the disconnection can be read as a single byte off the DataStreamReader obtained along with the event. That single byte will represent a value from the DisconnectReason enum.


    3
    In This Article
    • Fields
    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