Class Lidgren::Network::NetConnection
ClassList > Lidgren > Network > NetConnection
Represents a connection to a remote peer.
Public Properties
Type | Name |
---|---|
property float | AverageRoundtripTime Gets the current average roundtrip time in seconds. |
property int | CurrentMTU Gets the current MTU in bytes. If PeerConfiguration.AutoExpandMTU is false, this will be PeerConfiguration.MaximumTransmissionUnit. |
property NetOutgoingMessage | LocalHailMessage Gets the local hail message that was sent as part of the handshake. |
property NetPeer | Peer Gets the peer which holds this connection. |
property NetEndPoint | RemoteEndPoint Gets the remote endpoint for the connection. |
property NetIncomingMessage | RemoteHailMessage The message that the remote part specified via Connect() or Approve() - can be null. |
property float | RemoteTimeOffset Time offset between this peer and the remote peer. |
property long | RemoteUniqueIdentifier Gets the unique identifier of the remote NetPeer for this connection. |
property NetConnectionStatistics | Statistics Gets various statistics for this connection. |
property NetConnectionStatus | Status Gets the current status of the connection (synced to the last status message read) |
property object | Tag Gets or sets the application defined object containing data about the connection. |
Public Functions
Type | Name |
---|---|
void | Approve () Approves this connection; sending a connection response to the remote host. |
void | Approve (NetOutgoingMessage localHail) Approves this connection; sending a connection response to the remote host. |
bool | CanSendImmediately (NetDeliveryMethod method, int sequenceChannel) |
void | Deny () Denies this connection; disconnecting it. |
void | Deny (string reason) Denies this connection; disconnecting it. |
void | Disconnect (string byeMessage) Disconnect from the remote peer. |
double | GetLocalTime (double remoteTimestamp) Gets local time value comparable to NetTime.Now from a remote value. |
double | GetRemoteTime (double localTimestamp) Gets the remote time value for a local time value produced by NetTime.Now. |
void | GetSendQueueInfo (NetDeliveryMethod method, int sequenceChannel, out int windowSize, out int freeWindowSlots) Zero windowSize indicates that the channel is not yet instantiated (used) Negative freeWindowSlots means this amount of messages are currently queued but delayed due to closed window. |
NetSendResult | SendMessage (NetOutgoingMessage msg, NetDeliveryMethod method, int sequenceChannel) Send a message to this remote connection. |
override string | ToString () Returns a string that represents this object. |
Public Properties Documentation
property AverageRoundtripTime
property CurrentMTU
property LocalHailMessage
property Peer
property RemoteEndPoint
property RemoteHailMessage
property RemoteTimeOffset
property RemoteUniqueIdentifier
property Statistics
property Status
property Tag
Public Functions Documentation
function Approve [1/2]
function Approve [2/2]
Approves this connection; sending a connection response to the remote host.
Parameters:
localHail
The local hail message that will be set as RemoteHailMessage on the remote host
function CanSendImmediately
inline bool Lidgren::Network::NetConnection::CanSendImmediately (
NetDeliveryMethod method,
int sequenceChannel
)
function Deny [1/2]
function Deny [2/2]
Denies this connection; disconnecting it.
Parameters:
reason
The stated reason for the disconnect, readable as a string in the StatusChanged message on the remote host
function Disconnect
Disconnect from the remote peer.
Parameters:
byeMessage
the message to send with the disconnect message
function GetLocalTime
function GetRemoteTime
function GetSendQueueInfo
inline void Lidgren::Network::NetConnection::GetSendQueueInfo (
NetDeliveryMethod method,
int sequenceChannel,
out int windowSize,
out int freeWindowSlots
)
function SendMessage
Send a message to this remote connection.
inline NetSendResult Lidgren::Network::NetConnection::SendMessage (
NetOutgoingMessage msg,
NetDeliveryMethod method,
int sequenceChannel
)
Parameters:
msg
The message to sendmethod
How to deliver the messagesequenceChannel
Sequence channel within the delivery method
function ToString
The documentation for this class was generated from the following file api/unity-plugin/Scripts/Networking/Lidgren.Network/NetConnection.cs