TipcMtGetPriority


Name

TipcMtGetPriority — get the priority of a message type

Synopsis

T_BOOL TipcMtGetPriority(mt, priority_return) 
T_IPC_MT mt; 
T_INT2 *priority_return; 

Arguments

mt — message type to get priority from

priority_return — storage for message type priority

Return Values

TRUE if the priority was successfully retrieved from the message type, FALSE otherwise.

Diagnostics

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

Description

TipcMtGetPriority gets the priority of a message type. The priority of a message type, if set, is used as the default priority for messages of this type. The message type priority can either be set to a specific value or it can be unknown. When a message is created, its priority is initialized to the message type priority (if set) or to the value of the option Default_Msg_Priority (if the message type priority is unknown). See TipcMsgSetPriority for more information on message priorities.

The priority of an outgoing message can always be set on a per-message basis, but using message type priorities makes it easier to raise or lower the default priority for all outgoing messages of a specific type. Note that if set, the message type priority always overrides the value in the option Default_Msg_Priority. The standard SmartSockets message types by default all have a priority of unknown, but these can be changed. User-defined message types can also use whatever priority is appropriate.

When a message type is first created, its priority is initialized to unknown.

Caution

If TipcMtGetPriority returns FALSE, it does not store a value in priority_return.

See Also

TipcMtSetPriority, TipcMtSetPriorityUnknown

Examples

This example prints the priority of the NUMERIC_DATA message type:

T_IPC_MT mt; 
T_INT2 priority; 
 
mt = TipcMtLookup("numeric_data"); 
if (mt == NULL) { 
  return;  /* error */ 
} 
 
if (!TipcMtGetPriority(mt, &priority)) { 
  if (TutErrNumGet() == T_ERR_VAL_UNKNOWN) { 
    TutOut("NUMERIC_DATA msg type does not have priority set.\n"); 
  } 
  else { 
    return;  /* error */ 
  } 
} 
else { 
  TutOut("NUMERIC_DATA msg type has priority %d\n", priority); 
} 

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