TipcMsgGetType


Name

TipcMsgGetType — get the type of a message

Synopsis

T_BOOL TipcMsgGetType(msg, mt_return) 
T_IPC_MSG msg; 
T_IPC_MT *mt_return; 

Arguments

msg — message to get type from

mt_return — storage for message type

Return Values

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

Diagnostics

If TipcMsgGetType fails, it returns FALSE and sets the global SmartSockets error number to:

Description

TipcMsgGetType gets the type of a message. The type identifies the category of message being manipulated. Most connection callback types use a message type, for example, to allow various kinds of execution based on specific message types.

Caution

If TipcMsgGetType returns FALSE, it does not store a value in mt_return.

See Also

TipcMsgSetType, TipcMtLookupByNum, TipcMsgGetTypeNum

Examples

This gets the type of a message and prints the name and number of the message type:

void T_ENTRY print_msg_type_name(msg) 
T_IPC_MSG msg; 
{ 
  T_IPC_MT mt; 
  T_STR name; 
  T_INT4 num; 
  if (!TipcMsgGetType(msg, &mt)) { 
    return;  /* error */ 
  }  
  if (!TipcMtGetName(mt, &name)) { 
    return;  /* error */ 
  }  
  if (!TipcMtGetNum(mt, &num)) { 
    return;  /* error */ 
  }  
  TutOut("msg has type %s (number %d)\n", name, num); 
} /* print_msg_type_name */ 

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