Collapse All Expand All

.NET Framework Class Library
Tibems Class See Also

[TIBCO.EMS .NET client library 6.0 documentation]

Returns the total wire size of the message which was received or sent

Namespace: TIBCO.EMS
Assembly: TIBCO.EMS (in TIBCO.EMS.dll)

# Syntax

    public static int GetMessageSize(
    	Message msg
    )

    Public Shared Function GetMessageSize ( _
    	msg As Message _
    ) As Integer

    public:
    static int GetMessageSize(
    	Message^ msg
    )

#### Parameters

msg
  Type: TIBCO.EMS..::.Message
  The message for which to return the size.

#### Return Value

The total wire size of the message.

# Remarks

GetMessageSize returns the total size of a message—that is, the number of bytes that traverse the network when the client sends the message. This total is slightly larger than the sum of its three constituent parts, because it includes additional control information. Furthermore, the server adds its own control information as well, so the size of message as measured by receivers is slightly larger than its size as measured by the sender.

The size is implicitly measured and cached when an inbound message arrives at the client, and when the client sends an outbound message. If the client modifies a message, or creates a message but never sends it, then this method could yield an incorrect cached value. To explicitly force a new measurement and cache its results, call Tibems.CalculateMessageSize; then the method yields the correct value.

# Exceptions

Exception | Condition
--- | ---
System..::.ArgumentException | if parameter is null or is a foreign message implementation.

# See Also

Tibems Class
TIBCO.EMS Namespace