OpenJAUS Tutorials
JAUS Components
JAUS Messaging
| Tutorial: Managing Incoming Service Connections |
|
This tutorial is for OpenJAUS 3.3. OpenJAUS 3.3 is no longer in development or maintainence by the OpenJAUS team. This tutorial is provided for reference and support of legacy systems only. For new development please use OpenJAUS 4.0 Service connections in JAUS are a publish-subscribe mechanism for exchanging data between components (See the JAUS reference architecture for a full description of service connections). This tutorial describes how to create a service connection to receive data from another component. In OpenJAUS, these are referred to as incoming service connections, because the messages are flowing into the subscribing component.
If a non-zero subsystemId is specified in the source address field, then the component assumes the source address is complete and it attempts to request the service connection from that exact address. Otherwise, the component performs a system lookup for the component location based on componentId in the source address. The lookup assumes that the desired source is within the same subsystem as the requesting component. If an exact address of a component residing on another subsystem needs to be obtained then the ojCmptLookupAddress() function can be used. The queue size specified in the establish function call can be a positive integer or zero. A negative value will cause an error. If the value is zero then the maximum queue size is not limited. In order to explicitly terminate an established service connection, the ojCmptTerminateSc() function is used. This function simply takes the service connection descriptor value that was returned by the ojCmptEstablishSc() function. The example below shows how it is called.
|
0 Comments