C# Класс Lidgren.Network.NetConnection

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Approve ( ) : void

Approves this connection; sending a connection response to the remote host

Approve ( NetOutgoingMessage localHail ) : void

Approves this connection; sending a connection response to the remote host

CanSendImmediately ( NetDeliveryMethod method, int sequenceChannel ) : bool
Deny ( ) : void

Denies this connection; disconnecting it

Deny ( string reason ) : void

Denies this connection; disconnecting it

Disconnect ( string byeMessage ) : void

Disconnect from the remote peer

GetLocalTime ( double remoteTimestamp ) : double

Gets local time value comparable to NetTime.Now from a remote value

GetRemoteTime ( double localTimestamp ) : double

Gets the remote time value for a local time value produced by NetTime.Now

GetSendQueueInfo ( NetDeliveryMethod method, int sequenceChannel, int &windowSize, int &freeWindowSlots ) : void

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

SendMessage ( NetOutgoingMessage msg, NetDeliveryMethod method, int sequenceChannel ) : NetSendResult

Send a message to this remote connection

ToString ( ) : string

Returns a string that represents this object

Приватные методы

Метод Описание
CreateReceiverChannel ( NetMessageType tp ) : Lidgren.Network.NetReceiverChannelBase
CreateSenderChannel ( NetMessageType tp ) : Lidgren.Network.NetSenderChannelBase
EnqueueMessage ( NetOutgoingMessage msg, NetDeliveryMethod method, int sequenceChannel ) : NetSendResult
ExecuteDisconnect ( string reason, bool sendByeMessage ) : void
ExpandMTU ( double now ) : void
FinalizeMTU ( int size ) : void
GetResendDelay ( ) : float
HandleConnectResponse ( double now, NetMessageType tp, int ptr, int payloadLength ) : void
HandleExpandMTUSuccess ( double now, int size ) : void
Heartbeat ( float now, uint frameCounter ) : void
InitExpandMTU ( double now ) : void
InitializePing ( ) : void
InitializeRemoteTimeOffset ( float remoteSendTime ) : void
MTUExpansionHeartbeat ( double now ) : void
MutateEndPoint ( IPEndPoint endPoint ) : void

Change the internal endpoint to this new one. Used when, during handshake, a switch in port is detected (due to NAT)

NetConnection ( NetPeer peer, IPEndPoint remoteEndPoint ) : System
QueueAck ( NetMessageType tp, int sequenceNumber ) : void
QueueSendMessage ( NetOutgoingMessage om, int seqNr ) : void
ReceivedHandshake ( double now, NetMessageType tp, int ptr, int payloadLength ) : void
ReceivedLibraryMessage ( NetMessageType tp, int ptr, int payloadLength ) : void
ReceivedMessage ( NetIncomingMessage msg ) : void
ReceivedPong ( float now, int pongNumber, float remoteSendTime ) : void
SendConnect ( float now ) : void
SendConnectResponse ( float now, bool onLibraryThread ) : void
SendConnectionEstablished ( ) : void
SendDisconnect ( string reason, bool onLibraryThread ) : void
SendExpandMTU ( double now, int size ) : void
SendMTUSuccess ( int size ) : void
SendPing ( ) : void
SendPong ( int pingNumber ) : void
SetStatus ( NetConnectionStatus status, string reason ) : void
Shutdown ( string reason ) : void
UnconnectedHeartbeat ( float now ) : void
ValidateHandshakeData ( int ptr, int payloadLength, byte &hail ) : bool
WriteLocalHail ( NetOutgoingMessage om ) : void

Описание методов

Approve() публичный Метод

Approves this connection; sending a connection response to the remote host
public Approve ( ) : void
Результат void

Approve() публичный Метод

Approves this connection; sending a connection response to the remote host
public Approve ( NetOutgoingMessage localHail ) : void
localHail NetOutgoingMessage The local hail message that will be set as RemoteHailMessage on the remote host
Результат void

CanSendImmediately() публичный Метод

public CanSendImmediately ( NetDeliveryMethod method, int sequenceChannel ) : bool
method NetDeliveryMethod
sequenceChannel int
Результат bool

Deny() публичный Метод

Denies this connection; disconnecting it
public Deny ( ) : void
Результат void

Deny() публичный Метод

Denies this connection; disconnecting it
public Deny ( string reason ) : void
reason string The stated reason for the disconnect, readable as a string in the StatusChanged message on the remote host
Результат void

Disconnect() публичный Метод

Disconnect from the remote peer
public Disconnect ( string byeMessage ) : void
byeMessage string the message to send with the disconnect message
Результат void

GetLocalTime() публичный Метод

Gets local time value comparable to NetTime.Now from a remote value
public GetLocalTime ( double remoteTimestamp ) : double
remoteTimestamp double
Результат double

GetRemoteTime() публичный Метод

Gets the remote time value for a local time value produced by NetTime.Now
public GetRemoteTime ( double localTimestamp ) : double
localTimestamp double
Результат double

GetSendQueueInfo() публичный Метод

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
public GetSendQueueInfo ( NetDeliveryMethod method, int sequenceChannel, int &windowSize, int &freeWindowSlots ) : void
method NetDeliveryMethod
sequenceChannel int
windowSize int
freeWindowSlots int
Результат void

SendMessage() публичный Метод

Send a message to this remote connection
public SendMessage ( NetOutgoingMessage msg, NetDeliveryMethod method, int sequenceChannel ) : NetSendResult
msg NetOutgoingMessage The message to send
method NetDeliveryMethod How to deliver the message
sequenceChannel int Sequence channel within the delivery method
Результат NetSendResult

ToString() публичный Метод

Returns a string that represents this object
public ToString ( ) : string
Результат string