docs.unity3d.com
Search Results for

    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
    Assembly: Unity.Networking.Transport.dll
    Syntax
    public enum NetworkEvent.Type : short

    Fields

    Name Description
    Connect

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

    Data

    A message was received on the connection. The contents of the message can be read from the Unity.Collections.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).

    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 Unity.Collections.DataStreamReader obtained along with the event. That single byte will represent a value from the DisconnectReason enum.

    Empty

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

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)