docs.unity.cn
    Show / Hide Table of Contents

    Enum DisconnectReason

    Reason for a disconnection event.

    Namespace: Unity.Networking.Transport.Error
    Syntax
    public enum DisconnectReason : byte
    Remarks

    One of these values may be present as a single byte in the DataStreamReader obtained with PopEvent(out NetworkConnection, out DataStreamReader) if the event type is Disconnect.

    Fields

    Name Description Value
    Default

    Used internally when no other reason fits.


    This shouldn't normally appear as a result of calling PopEvent(out NetworkConnection, out DataStreamReader).

    0
    Timeout

    Indicates the connection timed out (see disconnectTimeoutMS).


    1
    MaxConnectionAttempts

    Indicates the connection failed to establish after too many failed attempts (see maxConnectAttempts).


    2
    ClosedByRemote

    Indicates the connection was closed normally by the remote peer after calling Disconnect(NetworkConnection) or .


    3
    Count

    Used internally to track the number of reasons. Keep last.


    4
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 28, 2023