- Message types are structured templates that describe what can go in a message, and each message can be considered an instance of a message type.
- SmartSockets comes with a number of ready-to-use standard message types. You can also define your own message types.
- A message consists of a set of header properties and a data part. The properties in a message are the same across all message types. Properties include its type, sender, destination, priority, read-only status, delivery mode, delivery timeout, load balancing mode, header string encode, reference count, sequence number, and a user-definable property.
- The data part of a message consists of fields that carry a unit of information. The message data can contain any number of fields, although most messages have a well-defined layout for their fields.
- SmartSockets converts all data to the proper format using a final-receiver-makes-right approach. You do not have to worry about any data translation between different platforms, except for IEEE to DEC floating-point conversion, which is currently not available in the SmartSockets Java Class Library.
- The SmartSockets Java Class Library has an extensive set of functions that allows you to create and copy messages, and to get and set any of the message properties, and to build and access the data part of a message.
- Typically, these steps are required when constructing a message:
- Create a message of a particular type (TipcSvc.msgCreate, TipcMsg.clone).
- Set the properties of the message (TipcMsg.set*).
- Append fields to the message data (TipcMsg.append*).
- Messages are read from RTserver using TipcSrv.next.
- Typically, retrieving information from the data part of a message consists of these steps:
- Set the message pointer to the field of interest (TipcMsg.setCurrent).
- Access the fields of the message (TipcMsg.next*).
- Individual fields in messages can be associated with a name. Named fields can be accessed by name or sequentially. Named fields and non-named fields can co-exist in the same message without conflict.