Show / Hide Table of Contents

Class NetEvent

Internally used event type

Inheritance
object
NetEvent
Namespace: LiteNetLib
Assembly: LiteNetLib.dll
Syntax
public sealed class NetEvent

Constructors

NetEvent(LiteNetManager)

Initializes a new instance of the NetEvent class.

Declaration
public NetEvent(LiteNetManager manager)
Parameters
Type Name Description
LiteNetManager manager

The LiteNetManager that owns the packet pool and buffers for this event.

Fields

ChannelNumber

The channel on which the packet was received.

Declaration
public byte ChannelNumber
Field Value
Type Description
byte

ConnectionRequest

Information about an incoming connection. Only valid when Type is ConnectionRequest.

Declaration
public LiteConnectionRequest ConnectionRequest
Field Value
Type Description
LiteConnectionRequest

DataReader

A reader for accessing the payload of received data, broadcast, or unconnected messages.

Declaration
public readonly NetPacketReader DataReader
Field Value
Type Description
NetPacketReader

DeliveryMethod

The delivery method used for the received packet. Only valid when Type is Receive.

Declaration
public DeliveryMethod DeliveryMethod
Field Value
Type Description
DeliveryMethod

DisconnectReason

The reason for a peer's disconnection. Only valid when Type is Disconnect.

Declaration
public DisconnectReason DisconnectReason
Field Value
Type Description
DisconnectReason

ErrorCode

The specific socket error. Only valid when Type is Error.

Declaration
public SocketError ErrorCode
Field Value
Type Description
SocketError

Latency

The updated latency value in milliseconds. Only valid when Type is ConnectionLatencyUpdated.

Declaration
public int Latency
Field Value
Type Description
int

Next

Reference to the next event in the pool or event queue.

Declaration
public NetEvent Next
Field Value
Type Description
NetEvent

Peer

The peer associated with this event. null for unconnected events.

Declaration
public LiteNetPeer Peer
Field Value
Type Description
LiteNetPeer

RemoteEndPoint

The remote endpoint (IP and Port) from which the event originated.

Declaration
public IPEndPoint RemoteEndPoint
Field Value
Type Description
IPEndPoint

Type

The type of network event that occurred.

Declaration
public NetEvent.EType Type
Field Value
Type Description
NetEvent.EType

UserData

Optional user data associated with a connection request or disconnect.

Declaration
public object UserData
Field Value
Type Description
object
In this article
Back to top Generated by DocFX