Description
The MessagesRecieved
property of the Connection
class provides the total number of messages that have been received from this particular connection. This property is useful for monitoring the communication activity of a connection, allowing developers to track how many messages have been successfully received over the network.
Usage
To access the MessagesRecieved
property, you need an instance of the Connection
class. This property is read-only and returns an integer value representing the count of received messages.
Example
// Example of accessing the MessagesRecieved property
// Assume 'connection' is an instance of Sandbox.Connection
int receivedMessages = connection.MessagesRecieved;
// Output the number of messages received
// Note: Avoid using Console.WriteLine in Sandbox
// Instead, use a logging system or UI element to display the information
Log.Info($"Messages received: {receivedMessages}");