







![]() ![]() ![]() |
Lidgren Network Library documentation |
NetPeer Members |
NetPeer Class Constructors Methods Properties See Also Send Feedback |
The NetPeer type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | NetPeer |
NetPeer constructor
|
Methods
Name | Description | |
---|---|---|
![]() | Connect(IPEndPoint) |
Create a connection to a remote endpoint
|
![]() | Connect(IPEndPoint, NetOutgoingMessage) |
Create a connection to a remote endpoint
|
![]() | Connect(String, Int32) |
Create a connection to a remote endpoint
|
![]() | Connect(String, Int32, NetOutgoingMessage) |
Create a connection to a remote endpoint
|
![]() | CreateMessage()()()() |
Creates a new message for sending
|
![]() | CreateMessage(Int32) |
Creates a new message for sending
|
![]() | CreateMessage(String) |
Creates a new message for sending and writes the provided string to it
|
![]() | DiscoverKnownPeer(IPEndPoint) |
Emit a discovery signal to a single known host
|
![]() | DiscoverKnownPeer(String, Int32) |
Emit a discovery signal to a single known host
|
![]() | DiscoverLocalPeers |
Emit a discovery signal to all hosts on your subnet
|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.) |
![]() | FlushSendQueue |
If NetPeerConfiguration.AutoFlushSendQueue() is false; you need to call this to send all messages queued using SendMessage()
|
![]() | GetConnection |
Get the connection, if any, for a certain remote endpoint
|
![]() | GetHashCode |
Serves as a hash function for a particular type.
(Inherited from Object.) |
![]() | GetType |
Gets the Type of the current instance.
(Inherited from Object.) |
![]() | Introduce |
Send NetIntroduction to hostExternal and clientExternal; introducing client to host
|
![]() | MemberwiseClone |
Creates a shallow copy of the current Object.
(Inherited from Object.) |
![]() | RawSend |
Send raw bytes; only used for debugging
|
![]() | ReadMessage |
Read a pending message from any connection, if any
|
![]() | ReadMessages |
Read a pending message from any connection, if any
|
![]() | Recycle(NetIncomingMessage) |
Recycles a NetIncomingMessage instance for reuse; taking pressure off the garbage collector
|
![]() | Recycle(IEnumerable<(Of <<'(NetIncomingMessage>)>>)) |
Recycles a list of NetIncomingMessage instances for reuse; taking pressure off the garbage collector
|
![]() | RegisterReceivedCallback |
Call this to register a callback for when a new message arrives
|
![]() | SendDiscoveryResponse |
Send a discovery response message
|
![]() | SendMessage(NetOutgoingMessage, NetConnection, NetDeliveryMethod) |
Send a message to a specific connection
|
![]() | SendMessage(NetOutgoingMessage, NetConnection, NetDeliveryMethod, Int32) |
Send a message to a specific connection
|
![]() | SendMessage(NetOutgoingMessage, List<(Of <<'(NetConnection>)>>), NetDeliveryMethod, Int32) |
Send a message to a list of connections
|
![]() | SendUnconnectedMessage(NetOutgoingMessage, IList<(Of <<'(IPEndPoint>)>>)) |
Send a message to an unconnected host
|
![]() | SendUnconnectedMessage(NetOutgoingMessage, IPEndPoint) |
Send a message to an unconnected host
|
![]() | SendUnconnectedMessage(NetOutgoingMessage, String, Int32) |
Send a message to an unconnected host
|
![]() | SendUnconnectedToSelf |
Send a message to this exact same netpeer (loopback)
|
![]() | Shutdown |
Disconnects all active connections and closes the socket
|
![]() | Start |
Binds to socket and spawns the networking thread
|
![]() | ToString | (Inherited from Object.) |
![]() | WaitMessage |
Read a pending message from any connection, blocking up to maxMillis if needed
|
Properties
Name | Description | |
---|---|---|
![]() | Configuration |
Gets the configuration used to instanciate this NetPeer
|
![]() | Connections |
Gets a copy of the list of connections
|
![]() | ConnectionsCount |
Gets the number of active connections
|
![]() | MessageReceivedEvent |
Signalling event which can be waited on to determine when a message is queued for reading.
Note that there is no guarantee that after the event is signaled the blocked thread will
find the message in the queue. Other user created threads could be preempted and dequeue
the message before the waiting thread wakes up.
|
![]() | Port |
Gets the port number this NetPeer is listening and sending on, if Start() has been called
|
![]() | Socket |
Gets the socket, if Start() has been called
|
![]() | Statistics |
Statistics on this NetPeer since it was initialized
|
![]() | Status |
Gets the NetPeerStatus of the NetPeer
|
![]() | Tag |
Gets or sets the application defined object containing data about the peer
|
![]() | UniqueIdentifier |
Gets a unique identifier for this NetPeer based on Mac address and ip/port. Note! Not available until Start() has been called!
|
![]() | UPnP |
Returns an UPnP object if enabled in the NetPeerConfiguration
|