C# Class Lidgren.Network.NetPeer

A client which can initiate and accept multiple connections
Inheritance: Lidgren.Network.NetServer
Afficher le fichier Open project: tomoprime/CrabBattle Class Usage Examples

Méthodes publiques

Méthode Description
CreateMessage ( ) : NetOutgoingMessage

Creates a new message for sending

CreateMessage ( int initialCapacity ) : NetOutgoingMessage

Creates a new message for sending

CreateMessage ( string content ) : NetOutgoingMessage

Creates a new message for sending and writes the provided string to it

Recycle ( NetIncomingMessage msg ) : void

Recycles a NetIncomingMessage instance for reuse; taking pressure off the garbage collector

RegisterReceivedCallback ( SendOrPostCallback callback ) : void

Call this to register a callback for when a new message arrives

SendMessage ( NetOutgoingMessage msg, NetConnection recipient, NetDeliveryMethod method ) : NetSendResult

Send a message to a specific connection

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

Send a message to a specific connection

SendMessage ( NetOutgoingMessage msg, IList recipients, NetDeliveryMethod method, int sequenceChannel ) : void

Send a message to a list of connections

SendUnconnectedMessage ( NetOutgoingMessage msg, IList recipients ) : void

Send a message to an unconnected host

SendUnconnectedMessage ( NetOutgoingMessage msg, IPEndPoint recipient ) : void

Send a message to an unconnected host

SendUnconnectedMessage ( NetOutgoingMessage msg, string host, int port ) : void

Send a message to an unconnected host

Private Methods

Méthode Description
AcceptConnection ( NetConnection conn ) : void
CreateIncomingMessage ( NetIncomingMessageType tp, byte useStorageData ) : NetIncomingMessage
CreateIncomingMessage ( NetIncomingMessageType tp, int minimumByteSize ) : NetIncomingMessage
CreateIncomingMessage ( NetIncomingMessageType tp, string text ) : NetIncomingMessage

Creates an incoming message with the required capacity for releasing to the application

ExecutePeerShutdown ( ) : void
GetMTU ( IList recipients ) : int
GetStorage ( int minimumCapacity ) : byte[]
HandleIncomingDiscoveryRequest ( double now, IPEndPoint senderEndpoint, int ptr, int payloadByteLength ) : void
HandleIncomingDiscoveryResponse ( double now, IPEndPoint senderEndpoint, int ptr, int payloadByteLength ) : void
Heartbeat ( ) : void
InitializeNetwork ( ) : void
InitializePools ( ) : void
NetworkLoop ( ) : void
ReceivedUnconnectedLibraryMessage ( double now, IPEndPoint senderEndpoint, NetMessageType tp, int ptr, int payloadByteLength ) : void
Recycle ( NetOutgoingMessage msg ) : void
Recycle ( byte storage ) : void
ReleaseMessage ( NetIncomingMessage msg ) : void
SetupReadHelperMessage ( int ptr, int payloadLength ) : NetIncomingMessage
VerifyNetworkThread ( ) : void

Method Details

CreateMessage() public méthode

Creates a new message for sending
public CreateMessage ( ) : NetOutgoingMessage
Résultat NetOutgoingMessage

CreateMessage() public méthode

Creates a new message for sending
public CreateMessage ( int initialCapacity ) : NetOutgoingMessage
initialCapacity int initial capacity in bytes
Résultat NetOutgoingMessage

CreateMessage() public méthode

Creates a new message for sending and writes the provided string to it
public CreateMessage ( string content ) : NetOutgoingMessage
content string
Résultat NetOutgoingMessage

Recycle() public méthode

Recycles a NetIncomingMessage instance for reuse; taking pressure off the garbage collector
public Recycle ( NetIncomingMessage msg ) : void
msg NetIncomingMessage
Résultat void

RegisterReceivedCallback() public méthode

Call this to register a callback for when a new message arrives
public RegisterReceivedCallback ( SendOrPostCallback callback ) : void
callback SendOrPostCallback
Résultat void

SendMessage() public méthode

Send a message to a specific connection
public SendMessage ( NetOutgoingMessage msg, NetConnection recipient, NetDeliveryMethod method ) : NetSendResult
msg NetOutgoingMessage The message to send
recipient NetConnection The recipient connection
method NetDeliveryMethod How to deliver the message
Résultat NetSendResult

SendMessage() public méthode

Send a message to a specific connection
public SendMessage ( NetOutgoingMessage msg, NetConnection recipient, NetDeliveryMethod method, int sequenceChannel ) : NetSendResult
msg NetOutgoingMessage The message to send
recipient NetConnection The recipient connection
method NetDeliveryMethod How to deliver the message
sequenceChannel int Sequence channel within the delivery method
Résultat NetSendResult

SendMessage() public méthode

Send a message to a list of connections
public SendMessage ( NetOutgoingMessage msg, IList recipients, NetDeliveryMethod method, int sequenceChannel ) : void
msg NetOutgoingMessage The message to send
recipients IList The list of recipients to send to
method NetDeliveryMethod How to deliver the message
sequenceChannel int Sequence channel within the delivery method
Résultat void

SendUnconnectedMessage() public méthode

Send a message to an unconnected host
public SendUnconnectedMessage ( NetOutgoingMessage msg, IList recipients ) : void
msg NetOutgoingMessage
recipients IList
Résultat void

SendUnconnectedMessage() public méthode

Send a message to an unconnected host
public SendUnconnectedMessage ( NetOutgoingMessage msg, IPEndPoint recipient ) : void
msg NetOutgoingMessage
recipient IPEndPoint
Résultat void

SendUnconnectedMessage() public méthode

Send a message to an unconnected host
public SendUnconnectedMessage ( NetOutgoingMessage msg, string host, int port ) : void
msg NetOutgoingMessage
host string
port int
Résultat void