TipcMsgSetCompression


Name

TipcMsgSetCompression — enable or disable message compression

Synopsis

T_BOOL TipcMsgSetCompression(msg, compress) 
T_IPC_MSG msg; 
T_BOOL compress; 

Arguments

msg — message to set compression for

compress — message compression status (TRUE to enable compression, FALSE to disable)

Return Values

TRUE if the compression status was successfully set for the message, FALSE otherwise.

Diagnostics

If TipcMsgSetCompression fails, it returns FALSE and sets the global SmartSockets error number to one of:

Description

TipcMsgSetCompression sets the compression status of a message. When the compression status is set to TRUE, the fields in the message are automatically compressed when the message is sent. The compression is performed using the algorithm specified by the Compression_Name option. The message is automatically decompressed when a receiver of the message attempts to access any of the message’s fields.

TipcMsgSetCompression overwrites the default compression status set by TipcMtSetCompression.

Caution

Do not send compressed messages to an RT process running on a SmartSockets software release lower than 6.5.0.

Sending a compressed message to an RT process running an earlier version of SmartSockets may result in unexpected behavior. Typically, the RT process running on an earlier version of SmartSockets returns an error code of T_ERR_FT_MISMATCH or T_ERR_FT_INVALID when attempting to access the fields of a compressed message. However, it is also possible for the RT process to retrieve invalid data from the field without generating an error.

See Also

TipcMsgGetCompression, TipcMtSetCompression

Examples

This example enables compression of a message:

if (!TipcMsgSetCompression(msg, T_TRUE)) { 
  return;  /* error */ 
} 

TIBCO SmartSockets™ Application Programming Interface
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com