Click or drag to resize

LiteNetPeer Class

Network peer. Main purpose is sending messages to specific peer.
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 LiteNetPeer : IPEndPoint

The LiteNetPeer 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 
Public propertyConnectionState Current connection state
Public propertyMtu Current MTU - Maximum Transfer Unit ( maximum udp packet size without fragmentation )
Public propertyPing Current one-way ping (RTT/2) in milliseconds
Public propertyPortGets or sets the port number of the endpoint.
(Inherited from IPEndPoint)
Public propertyRemoteId Id assigned from server
Public propertyRemoteTimeDelta Delta with remote time in ticks (not accurate) positive - remote time > our time
Public propertyRemoteUtcTime Remote UTC time (not accurate)
Public propertyRoundTripTime Round trip time in milliseconds
Public propertyTimeSinceLastPacket Time since last packet received (including internal library packets) in milliseconds
Top
Methods
 NameDescription
Public methodCreateCreates an endpoint from a socket address.
(Inherited from IPEndPoint)
Public methodCreatePacketFromPool Create temporary packet (maximum size MTU - headerSize) to send later without additional copies
Public methodDisconnect 
Public methodDisconnect(Byte) 
Public methodDisconnect(NetDataWriter) 
Public methodDisconnect(Byte, Int32, Int32) 
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
(Overrides IPEndPointGetHashCode)
Public methodGetMaxSinglePacketSize Gets maximum size of packet that will be not fragmented.
Public methodGetPacketsCountInReliableQueue Returns packets count in queue for reliable channel 0
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)
Public methodSend(NetDataWriter, DeliveryMethod) Send data to peer (channel - 0)
Public methodSend(ReadOnlySpanByte, DeliveryMethod) Send data to peer (channel - 0)
Public methodSend(Byte, Int32, Int32, DeliveryMethod) Send data to peer (channel - 0)
Protected methodSendInternal 
Public methodSendPooledPacket Sends pooled packet without data copy
Public methodSendWithDeliveryEvent(Byte, DeliveryMethod, Object) Send data to peer with delivery event called
Public methodSendWithDeliveryEvent(NetDataWriter, DeliveryMethod, Object) Send data to peer with delivery event called
Public methodSendWithDeliveryEvent(ReadOnlySpanByte, 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
Public methodSerialize IPEndPoint serialize
(Overrides IPEndPointSerialize)
Public methodToStringReturns the IP address and port number of the specified endpoint.
(Inherited from IPEndPoint)
Protected methodUpdateChannels 
Top
Fields
 NameDescription
Public fieldId Peer id can be used as key in your dictionary of peers
Public fieldNetManager Peer parent NetManager
Public fieldResendFixedDelay Fixed part of the resend delay
Public fieldResendRttMultiplier Multiplication factor of Rtt in the resend delay calculation
Public fieldStatistics Statistics of peer connection
Public fieldTag Application defined object containing data about the connection
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