Click or drag to resize

NetPeer Class

Improved LiteNetPeer with full multi-channel support
Inheritance Hierarchy
SystemObject
  System.NetEndPoint
    System.NetIPEndPoint
      LiteNetLibLiteNetPeer
        LiteNetLibNetPeer

Namespace: LiteNetLib
Assembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.2.1.0 (2026.2.1.0)
Syntax
C#
public class NetPeer : LiteNetPeer

The NetPeer type exposes the following members.

Properties
 NameDescription
Public propertyAddressGets or sets the IP address of the endpoint.
(Inherited from IPEndPoint)
Public propertyAddressFamilyGets the Internet Protocol (IP) address family.
(Inherited from IPEndPoint)
Protected propertyChannelsCount
(Overrides LiteNetPeerChannelsCount)
Public propertyConnectionState Current connection state
(Inherited from LiteNetPeer)
Public propertyMtu Current MTU - Maximum Transfer Unit ( maximum udp packet size without fragmentation )
(Inherited from LiteNetPeer)
Public propertyPing Current one-way ping (RTT/2) in milliseconds
(Inherited from LiteNetPeer)
Public propertyPortGets or sets the port number of the endpoint.
(Inherited from IPEndPoint)
Public propertyRemoteId Id assigned from server
(Inherited from LiteNetPeer)
Public propertyRemoteTimeDelta Delta with remote time in ticks (not accurate) positive - remote time > our time
(Inherited from LiteNetPeer)
Public propertyRemoteUtcTime Remote UTC time (not accurate)
(Inherited from LiteNetPeer)
Public propertyRoundTripTime Round trip time in milliseconds
(Inherited from LiteNetPeer)
Public propertyTimeSinceLastPacket Time since last packet received (including internal library packets) in milliseconds
(Inherited from LiteNetPeer)
Top
Methods
 NameDescription
Public methodCreateCreates an endpoint from a socket address.
(Inherited from IPEndPoint)
Public methodCreatePacketFromPool(DeliveryMethod) Create temporary packet (maximum size MTU - headerSize) to send later without additional copies
(Inherited from LiteNetPeer)
Public methodCreatePacketFromPool(DeliveryMethod, Byte) Create temporary packet (maximum size MTU - headerSize) to send later without additional copies
Public methodDisconnect
(Inherited from LiteNetPeer)
Public methodDisconnect(Byte)
(Inherited from LiteNetPeer)
Public methodDisconnect(NetDataWriter)
(Inherited from LiteNetPeer)
Public methodDisconnect(Byte, Int32, Int32)
(Inherited from LiteNetPeer)
Public methodEqualsDetermines whether the specified Object is equal to the current Object.
(Inherited from IPEndPoint)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCode
(Inherited from LiteNetPeer)
Public methodGetMaxSinglePacketSize Gets maximum size of packet that will be not fragmented.
(Inherited from LiteNetPeer)
Public methodGetPacketsCountInReliableQueue(Boolean) Returns packets count in queue for reliable channel 0
(Inherited from LiteNetPeer)
Public methodGetPacketsCountInReliableQueue(Byte, Boolean) Returns packets count in queue for reliable channel
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodSend(Byte, DeliveryMethod) Send data to peer (channel - 0)
(Inherited from LiteNetPeer)
Public methodSend(NetDataWriter, DeliveryMethod) Send data to peer (channel - 0)
(Inherited from LiteNetPeer)
Public methodSend(ReadOnlySpanByte, DeliveryMethod) Send data to peer (channel - 0)
(Inherited from LiteNetPeer)
Public methodSend(Byte, Byte, DeliveryMethod) Send data to peer
Public methodSend(NetDataWriter, Byte, DeliveryMethod) Send data to peer
Public methodSend(ReadOnlySpanByte, Byte, DeliveryMethod) Send data to peer
Public methodSend(Byte, Int32, Int32, DeliveryMethod) Send data to peer (channel - 0)
(Inherited from LiteNetPeer)
Public methodSend(Byte, Int32, Int32, Byte, DeliveryMethod) Send data to peer
Protected methodSendInternal
(Inherited from LiteNetPeer)
Public methodSendPooledPacket Sends pooled packet without data copy
(Inherited from LiteNetPeer)
Public methodSendWithDeliveryEvent(Byte, DeliveryMethod, Object) Send data to peer with delivery event called
(Inherited from LiteNetPeer)
Public methodSendWithDeliveryEvent(NetDataWriter, DeliveryMethod, Object) Send data to peer with delivery event called
(Inherited from LiteNetPeer)
Public methodSendWithDeliveryEvent(ReadOnlySpanByte, DeliveryMethod, Object) Send data to peer with delivery event called
(Inherited from LiteNetPeer)
Public methodSendWithDeliveryEvent(Byte, Byte, DeliveryMethod, Object) Send data to peer with delivery event called
Public methodSendWithDeliveryEvent(NetDataWriter, Byte, DeliveryMethod, Object) Send data to peer with delivery event called
Public methodSendWithDeliveryEvent(ReadOnlySpanByte, Byte, DeliveryMethod, Object) Send data to peer with delivery event called
Public methodSendWithDeliveryEvent(Byte, Int32, Int32, DeliveryMethod, Object) Send data to peer with delivery event called
(Inherited from LiteNetPeer)
Public methodSendWithDeliveryEvent(Byte, Int32, Int32, Byte, DeliveryMethod, Object) Send data to peer with delivery event called
Public methodSerialize IPEndPoint serialize
(Inherited from LiteNetPeer)
Public methodToStringReturns the IP address and port number of the specified endpoint.
(Inherited from IPEndPoint)
Protected methodUpdateChannels
(Overrides LiteNetPeerUpdateChannels)
Top
Fields
 NameDescription
Public fieldId Peer id can be used as key in your dictionary of peers
(Inherited from LiteNetPeer)
Public fieldNetManager Peer parent NetManager
(Inherited from LiteNetPeer)
Public fieldResendFixedDelay Fixed part of the resend delay
(Inherited from LiteNetPeer)
Public fieldResendRttMultiplier Multiplication factor of Rtt in the resend delay calculation
(Inherited from LiteNetPeer)
Public fieldStatistics Statistics of peer connection
(Inherited from LiteNetPeer)
Public fieldTag Application defined object containing data about the connection
(Inherited from LiteNetPeer)
Top
Extension Methods
 NameDescription
Public Extension MethodMethodInvoke Calls the object method by name.
(Defined by ObjectEx)
Public Extension MethodPropertyGet Gets the value of the object property by name.
(Defined by ObjectEx)
Public Extension MethodPropertyGetT Gets the value of the object property by name.
(Defined by ObjectEx)
Public Extension MethodPropertySet Sets the value of the object property by name.
(Defined by ObjectEx)
Top
See Also