When a standard message type does not satisfy a requirement of the application, a new message type can be created. Once created, the user-defined message type is handled in the same manner as a standard message type. To create a user-defined message type, use the function TipcMtCreate. This example creates a message type named XYZ_COORD_DATA
, where messages of type XYZ_COORD_DATA
have three fields (X, Y, and Z coordinates) that are four-byte integers.
#define XYZ_COORD_DATA 1001
mt = TipcMtCreate("xyz_coord_data", XYZ_COORD_DATA, "int4 int4
int4");
if (mt == NULL) {
/* error */
}
If a user-defined message type is going to be used in several programs, it must be created with TipcMtCreate in all of those programs. The recommended way of coordinating this in a multi-program project is to place all calls to TipcMtCreate in a C/C++ function that all programs then call during initialization. The common function is then placed in a common object library that all programs are linked with. For example of how this can be done, see Working With RTclient.
![]() |
RTserver does not need to call TipcMtCreate for user-defined message types to route the user-defined messages.
|
TIBCO SmartSockets™ User’s Guide Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |