Net |
public class NetManager : LiteNetManager, IEnumerable<NetPeer>, IEnumerable
The NetManager type exposes the following members.
| Name | Description | |
|---|---|---|
| NetManager | Initializes a new instance of the NetManager class |
| Name | Description | |
|---|---|---|
| ChannelsCount | QoS channel count per message type (value must be between 1 and 64 channels) | |
| ConnectedPeersCount |
Returns connected peers count
(Inherited from LiteNetManager) | |
| ExtraPacketSizeForLayer |
Gets the additional size in bytes required by the active PacketLayerBase.
(Inherited from LiteNetManager) | |
| FirstPeer | First peer. Useful for Client mode | |
| IsRunning |
Returns true if socket listening and update thread is running
(Inherited from LiteNetManager) | |
| LocalPort |
Local EndPoint (host and port)
(Inherited from LiteNetManager) | |
| NatPunchModule |
NatPunchModule for NAT hole punching operations
(Inherited from LiteNetManager) | |
| PoolCount | (Inherited from LiteNetManager) | |
| Ttl | (Inherited from LiteNetManager) |
| Name | Description | |
|---|---|---|
| AddPeerToSet | (Inherited from LiteNetManager) | |
| Connect(IPEndPoint, NetDataWriter) | Connect to remote host | |
| Connect(IPEndPoint, ReadOnlySpanByte) | Connect to remote host | |
| Connect(IPEndPoint, String) | Connect to remote host | |
| Connect(String, Int32, NetDataWriter) | Connect to remote host | |
| Connect(String, Int32, String) | Connect to remote host | |
| ContainsPeer | (Inherited from LiteNetManager) | |
| CreateConnectionRequest | (Overrides LiteNetManagerCreateConnectionRequest(IPEndPoint, NetConnectRequestPacket)) | |
| CreateIncomingPeer | (Overrides LiteNetManagerCreateIncomingPeer(LiteConnectionRequest, Int32)) | |
| CreateNtpRequest(IPEndPoint) | Create the requests for NTP server | |
| CreateNtpRequest(String) | Create the requests for NTP server (default port) | |
| CreateNtpRequest(String, Int32) | Create the requests for NTP server | |
| CreateOutgoingPeer | (Overrides LiteNetManagerCreateOutgoingPeer(IPEndPoint, Int32, Byte, ReadOnlySpanByte)) | |
| CreateRejectPeer | (Overrides LiteNetManagerCreateRejectPeer(IPEndPoint, Int32)) | |
| DisconnectAll |
Disconnect all peers without any additional data
(Inherited from LiteNetManager) | |
| DisconnectAll(Byte, Int32, Int32) |
Disconnect all peers with shutdown message
(Inherited from LiteNetManager) | |
| DisconnectPeer(LiteNetPeer) |
Disconnect peer from server
(Inherited from LiteNetManager) | |
| DisconnectPeer(LiteNetPeer, NetDataWriter) |
Disconnect peer from server and send additional data (Size must be less or equal MTU - 8)
(Inherited from LiteNetManager) | |
| DisconnectPeer(LiteNetPeer, Byte) |
Disconnect peer from server and send additional data (Size must be less or equal MTU - 8)
(Inherited from LiteNetManager) | |
| DisconnectPeer(LiteNetPeer, Byte, Int32, Int32) |
Disconnect peer from server and send additional data (Size must be less or equal MTU - 8)
(Inherited from LiteNetManager) | |
| DisconnectPeerForce |
Immediately disconnect peer from server without additional data
(Inherited from LiteNetManager) | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) | |
| GetConnectedPeers(ListLiteNetPeer) |
Get copy of connected peers (without allocations)
(Inherited from LiteNetManager) | |
| GetConnectedPeers(ListNetPeer) | Get copy of connected peers (without allocations) | |
| GetEnumerator | ||
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetPeerById |
Gets peer by peer id
(Inherited from LiteNetManager) | |
| GetPeers(ListLiteNetPeer, ConnectionState) |
Get copy of peers (without allocations)
(Inherited from LiteNetManager) | |
| GetPeers(ListNetPeer, ConnectionState) | Get copy of peers (without allocations) | |
| GetPeersCount |
Return peers count with connection state
(Inherited from LiteNetManager) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| ManualUpdate |
Updates internal peer states, handles timeouts, processes NTP requests and sends buffered packets.
(Inherited from LiteNetManager) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) | |
| PollEvents |
Synchronizes arrived events from the background thread to your main-thread/INetEventListener (Inherited from LiteNetManager) | |
| ProcessEvent | (Overrides LiteNetManagerProcessEvent(NetEvent)) | |
| ProcessNtpRequests | (Overrides LiteNetManagerProcessNtpRequests(Single)) | |
| RemovePeerFromSet | (Inherited from LiteNetManager) | |
| SendBroadcast(Byte, Int32) | (Inherited from LiteNetManager) | |
| SendBroadcast(NetDataWriter, Int32) | (Inherited from LiteNetManager) | |
| SendBroadcast(Byte, Int32, Int32, Int32) | (Inherited from LiteNetManager) | |
| SendToAll(Byte, DeliveryMethod) |
Send data to all connected peers (channel - 0)
(Inherited from LiteNetManager) | |
| SendToAll(NetDataWriter, DeliveryMethod) |
Send data to all connected peers (channel - 0)
(Inherited from LiteNetManager) | |
| SendToAll(ReadOnlySpanByte, DeliveryMethod) |
Send data to all connected peers (channel - 0)
(Inherited from LiteNetManager) | |
| SendToAll(Byte, DeliveryMethod, LiteNetPeer) |
Send data to all connected peers (channel - 0)
(Inherited from LiteNetManager) | |
| SendToAll(Byte, Byte, DeliveryMethod) | Send data to all connected peers | |
| SendToAll(NetDataWriter, DeliveryMethod, LiteNetPeer) |
Send data to all connected peers (channel - 0)
(Inherited from LiteNetManager) | |
| SendToAll(NetDataWriter, Byte, DeliveryMethod) | Send data to all connected peers | |
| SendToAll(ReadOnlySpanByte, DeliveryMethod, LiteNetPeer) |
Send data to all connected peers (channel - 0)
(Inherited from LiteNetManager) | |
| SendToAll(Byte, Int32, Int32, DeliveryMethod) |
Send data to all connected peers (channel - 0)
(Inherited from LiteNetManager) | |
| SendToAll(Byte, Byte, DeliveryMethod, LiteNetPeer) | Send data to all connected peers | |
| SendToAll(NetDataWriter, Byte, DeliveryMethod, LiteNetPeer) | Send data to all connected peers | |
| SendToAll(Byte, Int32, Int32, DeliveryMethod, LiteNetPeer) |
Send data to all connected peers
(Inherited from LiteNetManager) | |
| SendToAll(Byte, Int32, Int32, Byte, DeliveryMethod) | Send data to all connected peers | |
| SendToAll(Byte, Int32, Int32, Byte, DeliveryMethod, LiteNetPeer) | Send data to all connected peers | |
| SendUnconnectedMessage(Byte, IPEndPoint) |
Send message without connection
(Inherited from LiteNetManager) | |
| SendUnconnectedMessage(NetDataWriter, IPEndPoint) |
Send message without connection
(Inherited from LiteNetManager) | |
| SendUnconnectedMessage(ReadOnlySpanByte, IPEndPoint) |
Send message without connection
(Inherited from LiteNetManager) | |
| SendUnconnectedMessage(NetDataWriter, String, Int32) |
Send message without connection. WARNING This method allocates a new IPEndPoint object and
synchronously makes a DNS request. If you're calling this method every frame it will be
much faster to just cache the IPEndPoint.
(Inherited from LiteNetManager) | |
| SendUnconnectedMessage(Byte, Int32, Int32, IPEndPoint) |
Send message without connection
(Inherited from LiteNetManager) | |
| Start |
Start logic thread and listening on available port
(Inherited from LiteNetManager) | |
| Start(Int32) |
Start logic thread and listening on selected port
(Inherited from LiteNetManager) | |
| Start(IPAddress, IPAddress, Int32) |
Start logic thread and listening on selected port
(Inherited from LiteNetManager) | |
| Start(String, String, Int32) |
Start logic thread and listening on selected port
(Inherited from LiteNetManager) | |
| Start(IPAddress, IPAddress, Int32, Boolean) |
Start logic thread and listening on selected port
(Inherited from LiteNetManager) | |
| StartInManualMode(Int32) |
Start in manual mode and listening on selected port
In this mode you should use ManualReceive (without PollEvents) for receive packets
and ManualUpdate(...) for update and send packets
This mode useful mostly for single-threaded servers
(Inherited from LiteNetManager) | |
| StartInManualMode(IPAddress, IPAddress, Int32) |
Start in manual mode and listening on selected port
In this mode you should use ManualReceive (without PollEvents) for receive packets
and ManualUpdate(...) for update and send packets
This mode useful mostly for single-threaded servers
(Inherited from LiteNetManager) | |
| StartInManualMode(String, String, Int32) |
Start in manual mode and listening on selected port
In this mode you should use ManualReceive (without PollEvents) for receive packets
and ManualUpdate(...) for update and send packets
This mode useful mostly for single-threaded servers
(Inherited from LiteNetManager) | |
| Stop |
Force closes connection and stop all threads.
(Inherited from LiteNetManager) | |
| Stop(Boolean) |
Force closes connection and stop all threads.
(Inherited from LiteNetManager) | |
| ToString | Returns a string that represents the current object. (Inherited from Object) | |
| TriggerUpdate |
Triggers update and send logic immediately (works asynchronously)
(Inherited from LiteNetManager) | |
| TryGetPeerById |
Gets peer by peer id
(Inherited from LiteNetManager) |
| Name | Description | |
|---|---|---|
| _headPeer | (Inherited from LiteNetManager) | |
| _peersLock | (Inherited from LiteNetManager) | |
| _udpSocketv4 | (Inherited from LiteNetManager) | |
| AllowPeerAddressChange |
Allows peer change it's ip (lte to wifi, wifi to lte, etc). Use only on server
(Inherited from LiteNetManager) | |
| AutoRecycle |
Automatically recycle NetPacketReader after OnReceive event
(Inherited from LiteNetManager) | |
| BroadcastReceiveEnabled |
Allows receive broadcast packets
(Inherited from LiteNetManager) | |
| DisconnectOnUnreachable |
Disconnect peers if HostUnreachable or NetworkUnreachable spawned (old behaviour 0.9.x was true)
(Inherited from LiteNetManager) | |
| DisconnectTimeout |
If NetManager doesn't receive any packet from remote peer during this time (in milliseconds) then connection will be closed
(including library internal keepalive packets)
(Inherited from LiteNetManager) | |
| DontRoute |
UDP Only Socket Option
Normally IP sockets send packets of data through routers and gateways until they reach the final destination.
If the DontRoute flag is set to True, then data will be delivered on the local subnet only.
(Inherited from LiteNetManager) | |
| EnableStatistics |
Toggles the collection of network statistics for the instance and all known peers
(Inherited from LiteNetManager) | |
| IPv6Enabled |
IPv6 support
(Inherited from LiteNetManager) | |
| MaxConnectAttempts |
Maximum connection attempts before client stops and call disconnect event.
(Inherited from LiteNetManager) | |
| MaxFragmentsCount |
Max fragmented packets size for reliable channels - that equals to data of size fragments count * (MTU-reliable header size)
(Inherited from LiteNetManager) | |
| MaxPacketPerManualReceive |
Maximum packets that can be received per one ManualReceive (PollEvents when started using StartInManualMode)
0 - infinite - but this can cause some big delays there is too many incoming packets
(Inherited from LiteNetManager) | |
| MtuDiscovery |
Automatically discovery mtu starting from. Use at own risk because some routers can break MTU detection
and connection in result
(Inherited from LiteNetManager) | |
| MtuOverride |
Override MTU for all new peers registered in this NetManager, will ignores MTU Discovery!
(Inherited from LiteNetManager) | |
| NatPunchEnabled |
Enable nat punch messages
(Inherited from LiteNetManager) | |
| PacketPoolSize |
Maximum packet pool size (increase if you have tons of packets sending)
(Inherited from LiteNetManager) | |
| PingInterval |
Interval for latency detection and checking connection (in milliseconds)
(Inherited from LiteNetManager) | |
| ReceivePollingTime |
Poll timeout in microseconds. Increasing can slightly increase performance in cost of slow NetManager.Stop(Socket.Close)
(Inherited from LiteNetManager) | |
| ReconnectDelay |
Delay between initial connection attempts (in milliseconds)
(Inherited from LiteNetManager) | |
| ReuseAddress |
Enables socket option "ReuseAddress" for specific purposes
(Inherited from LiteNetManager) | |
| SimulateLatency |
Simulate latency by holding packets for random time. (Works only in DEBUG builds or when SIMULATE_NETWORK is defined)
(Inherited from LiteNetManager) | |
| SimulatePacketLoss |
Simulate packet loss by dropping random amount of packets. (Works only in DEBUG builds or when SIMULATE_NETWORK is defined)
(Inherited from LiteNetManager) | |
| SimulationMaxLatency |
Maximum simulated round-trip latency (in milliseconds). Actual latency applied per direction is half of this value.
(Inherited from LiteNetManager) | |
| SimulationMinLatency |
Minimum simulated round-trip latency (in milliseconds). Actual latency applied per direction is half of this value.
(Inherited from LiteNetManager) | |
| SimulationPacketLossChance |
Chance of packet loss when simulation enabled. value in percents (1 - 100).
(Inherited from LiteNetManager) | |
| Statistics |
Statistics of all connections
(Inherited from LiteNetManager) | |
| UnconnectedMessagesEnabled |
Enable messages receiving without connection. (with SendUnconnectedMessage method)
(Inherited from LiteNetManager) | |
| UnsyncedDeliveryEvent |
If true - delivery event will be called from "receive" thread immediately otherwise on PollEvents call
(Inherited from LiteNetManager) | |
| UnsyncedEvents |
Events automatically will be called without PollEvents method from another thread
(Inherited from LiteNetManager) | |
| UnsyncedReceiveEvent |
If true - receive event will be called from "receive" thread immediately otherwise on PollEvents call
(Inherited from LiteNetManager) | |
| UpdateTime |
Library logic update and send period in milliseconds
Lowest values in Windows doesn't change much because of Thread.Sleep precision
To more frequent sends (or sends tied to your game logic) use TriggerUpdate (Inherited from LiteNetManager) | |
| UseNativeSockets |
Experimental feature mostly for servers. Only for Windows/Linux
use direct socket calls for send/receive to drastically increase speed and reduce GC pressure
(Inherited from LiteNetManager) |
| Name | Description | |
|---|---|---|
| ForEachNetPeer | (Defined by RcCollectionExtensions) | |
| MethodInvoke |
Calls the object method by name.
(Defined by ObjectEx) | |
| PropertyGet |
Gets the value of the object property by name.
(Defined by ObjectEx) | |
| PropertyGetT |
Gets the value of the object property by name.
(Defined by ObjectEx) | |
| PropertySet |
Sets the value of the object property by name.
(Defined by ObjectEx) |