namespace FishNet.Transporting
{
///
/// States the local connection can be in.
///
[System.Flags]
public enum LocalConnectionState : int
{
///
/// Connection is fully stopped.
///
Stopped = (1 << 0),
///
/// Connection is stopping.
///
Stopping = (1 << 1),
///
/// Connection is starting but not yet established.
///
Starting = (1 << 2),
///
/// Connection is established.
///
Started = (1 << 3),
// StoppedError = (1 << 4),
// StoppedClosed = (1 << 5),
}
public static class LocalConnectionStateExtensions
{
///
/// True if the connection state is stopped or stopping.
///
public static bool IsStoppedOrStopping(this LocalConnectionState connectionState) => (connectionState == LocalConnectionState.Stopped || connectionState == LocalConnectionState.Stopping);
///
/// True if the connection state is started or starting.
///
public static bool IsStartedOrStarting(this LocalConnectionState connectionState) => (connectionState == LocalConnectionState.Started || connectionState == LocalConnectionState.Starting);
}
///
/// States a remote client can be in.
///
public enum RemoteConnectionState : byte
{
///
/// Connection is fully stopped.
///
Stopped = 0,
///
/// Connection is established.
///
Started = 2,
}
}