|
NetPeer | GetPeerById (int id) |
| Gets peer by peer id.
|
|
| NetManager (INetEventListener listener, PacketLayerBase extraPacketLayer=null) |
| NetManager constructor.
|
|
void | ManualUpdate (int elapsedMilliseconds) |
| Update and send logic. Use this only when NetManager started in manual mode.
|
|
void | ManualReceive () |
| Receive logic. It will call Receive events immediately without need to use PollEvents or UnsyncedEvents Use this only when NetManager started in manual mode.
|
|
void | SendToAll (NetDataWriter writer, DeliveryMethod options) |
| Send data to all connected peers (channel - 0)
|
|
void | SendToAll (byte[] data, DeliveryMethod options) |
| Send data to all connected peers (channel - 0)
|
|
void | SendToAll (byte[] data, int start, int length, DeliveryMethod options) |
| Send data to all connected peers (channel - 0)
|
|
void | SendToAll (NetDataWriter writer, byte channelNumber, DeliveryMethod options) |
| Send data to all connected peers.
|
|
void | SendToAll (byte[] data, byte channelNumber, DeliveryMethod options) |
| Send data to all connected peers.
|
|
void | SendToAll (byte[] data, int start, int length, byte channelNumber, DeliveryMethod options) |
| Send data to all connected peers.
|
|
void | SendToAll (NetDataWriter writer, DeliveryMethod options, NetPeer excludePeer) |
| Send data to all connected peers (channel - 0)
|
|
void | SendToAll (byte[] data, DeliveryMethod options, NetPeer excludePeer) |
| Send data to all connected peers (channel - 0)
|
|
void | SendToAll (byte[] data, int start, int length, DeliveryMethod options, NetPeer excludePeer) |
| Send data to all connected peers (channel - 0)
|
|
void | SendToAll (NetDataWriter writer, byte channelNumber, DeliveryMethod options, NetPeer excludePeer) |
| Send data to all connected peers.
|
|
void | SendToAll (byte[] data, byte channelNumber, DeliveryMethod options, NetPeer excludePeer) |
| Send data to all connected peers.
|
|
void | SendToAll (byte[] data, int start, int length, byte channelNumber, DeliveryMethod options, NetPeer excludePeer) |
| Send data to all connected peers.
|
|
bool | Start () |
| Start logic thread and listening on available port.
|
|
bool | Start (IPAddress addressIPv4, IPAddress addressIPv6, int port) |
| Start logic thread and listening on selected port.
|
|
bool | Start (string addressIPv4, string addressIPv6, int port) |
| Start logic thread and listening on selected port.
|
|
bool | Start (int port) |
| Start logic thread and listening on selected port.
|
|
bool | StartInManualMode (IPAddress addressIPv4, IPAddress addressIPv6, int port) |
| 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.
|
|
bool | StartInManualMode (string addressIPv4, string addressIPv6, int port) |
| 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.
|
|
bool | StartInManualMode (int port) |
| 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.
|
|
bool | SendUnconnectedMessage (byte[] message, IPEndPoint remoteEndPoint) |
| Send message without connection.
|
|
bool | SendUnconnectedMessage (NetDataWriter writer, IPEndPoint remoteEndPoint) |
| Send message without connection.
|
|
bool | SendUnconnectedMessage (byte[] message, int start, int length, IPEndPoint remoteEndPoint) |
| Send message without connection.
|
|
bool | SendBroadcast (NetDataWriter writer, int port) |
|
bool | SendBroadcast (byte[] data, int port) |
|
bool | SendBroadcast (byte[] data, int start, int length, int port) |
|
void | TriggerUpdate () |
| Triggers update and send logic immediately (works asynchronously)
|
|
void | PollEvents () |
| Receive all pending events. Call this in game update code.
|
|
NetPeer | Connect (string address, int port, string key) |
| Connect to remote host.
|
|
NetPeer | Connect (string address, int port, NetDataWriter connectionData) |
| Connect to remote host.
|
|
NetPeer | Connect (IPEndPoint target, string key) |
| Connect to remote host.
|
|
NetPeer | Connect (IPEndPoint target, NetDataWriter connectionData) |
| Connect to remote host.
|
|
void | Stop () |
| Force closes connection and stop all threads.
|
|
void | Stop (bool sendDisconnectMessages) |
| Force closes connection and stop all threads.
|
|
int | GetPeersCount (ConnectionState peerState) |
| Return peers count with connection state.
|
|
void | GetPeersNonAlloc (List< NetPeer > peers, ConnectionState peerState) |
| Get copy of peers (without allocations)
|
|
void | DisconnectAll () |
| Disconnect all peers without any additional data.
|
|
void | DisconnectAll (byte[] data, int start, int count) |
| Disconnect all peers with shutdown message.
|
|
void | DisconnectPeerForce (NetPeer peer) |
| Immediately disconnect peer from server without additional data.
|
|
void | DisconnectPeer (NetPeer peer) |
| Disconnect peer from server.
|
|
void | DisconnectPeer (NetPeer peer, byte[] data) |
| Disconnect peer from server and send additional data (Size must be less or equal MTU - 8)
|
|
void | DisconnectPeer (NetPeer peer, NetDataWriter writer) |
| Disconnect peer from server and send additional data (Size must be less or equal MTU - 8)
|
|
void | DisconnectPeer (NetPeer peer, byte[] data, int start, int count) |
| Disconnect peer from server and send additional data (Size must be less or equal MTU - 8)
|
|
void | CreateNtpRequest (IPEndPoint endPoint) |
| Create the requests for NTP server.
|
|
void | CreateNtpRequest (string ntpServerAddress, int port) |
| Create the requests for NTP server.
|
|
void | CreateNtpRequest (string ntpServerAddress) |
| Create the requests for NTP server (default port)
|
|
NetPeerEnumerator | GetEnumerator () |
|
|
bool | UnconnectedMessagesEnabled = false |
| Enable messages receiving without connection. (with SendUnconnectedMessage method)
|
|
bool | NatPunchEnabled = false |
| Enable nat punch messages.
|
|
int | UpdateTime = 15 |
| Library logic update and send period in milliseconds.
|
|
int | PingInterval = 1000 |
| Interval for latency detection and checking connection.
|
|
int | DisconnectTimeout = 5000 |
| If NetManager doesn't receive any packet from remote peer during this time then connection will be closed (including library internal keepalive packets)
|
|
bool | SimulatePacketLoss = false |
| Simulate packet loss by dropping random amount of packets. (Works only in DEBUG mode)
|
|
bool | SimulateLatency = false |
| Simulate latency by holding packets for random time. (Works only in DEBUG mode)
|
|
int | SimulationPacketLossChance = 10 |
| Chance of packet loss when simulation enabled. value in percents (1 - 100).
|
|
int | SimulationMinLatency = 30 |
| Minimum simulated latency.
|
|
int | SimulationMaxLatency = 100 |
| Maximum simulated latency.
|
|
bool | UnsyncedEvents = false |
| Events automatically will be called without PollEvents method from another thread.
|
|
bool | UnsyncedReceiveEvent = false |
| If true - receive event will be called from "receive" thread immediately otherwise on PollEvents call.
|
|
bool | UnsyncedDeliveryEvent = false |
| If true - delivery event will be called from "receive" thread immediately otherwise on PollEvents call.
|
|
bool | BroadcastReceiveEnabled = false |
| Allows receive broadcast packets.
|
|
int | ReconnectDelay = 500 |
| Delay between initial connection attempts.
|
|
int | MaxConnectAttempts = 10 |
| Maximum connection attempts before client stops and call disconnect event.
|
|
bool | ReuseAddress = false |
| Enables socket option "ReuseAddress" for specific purposes.
|
|
readonly NetStatistics | Statistics |
| Statistics of all connections.
|
|
bool | EnableStatistics = false |
| Toggles the collection of network statistics for the instance and all known peers.
|
|
readonly NatPunchModule | NatPunchModule |
| NatPunchModule for NAT hole punching operations.
|
|
bool | AutoRecycle |
| Automatically recycle NetPacketReader after OnReceive event.
|
|
IPv6Mode | IPv6Enabled = IPv6Mode.SeparateSocket |
| IPv6 support.
|
|
int | MtuOverride = 0 |
| Override MTU for all new peers registered in this NetManager, will ignores MTU Discovery!
|
|
bool | UseSafeMtu = false |
| Sets initial MTU to lowest possible value according to RFC1191 (576 bytes)
|
|
bool | DisconnectOnUnreachable = false |
| Disconnect peers if HostUnreachable or NetworkUnreachable spawned (old behaviour 0.9.x was true)
|
|
Main class for all network operations. Can be used as client and/or server.