|
GEOS SDK TechDocs
|
|
6.1 IACP Overview
|
6.3 Messages Across an IACP Link
GenApplicationClass
is built to support IACP automatically. If a server or client object is subclassed from
GenApplicationClass
, most of the work of supporting IACP is done transparently to the application writer. The following capabilities are built in:
-
The Application Object automatically registers itself as a server for the appropriate list when it is launched in application mode. If it is launched in engine mode, it registers itself when it receives MSG_META_APP_STARTUP. If the last client-connection to the application is closed, and the Application is not currently running in application mode, the Application object will shut down automatically.
-
When the Application object registers itself as a server for its own list, it sends itself MSG_GEN_APPLICATION_IACP_REGISTER. An application may subclass this if it wants to take other action at this time (e.g. registering itself for other lists). Similarly, when an Application object unregisters itself from its own server list, it sends itself MSG_GEN_APPLICATION_IACP_UNREGISTER.
-
The Application object automatically handles the MSG_META_IACP... messages appropriately. In particular, when the kernel passes an encapsulated message to an Application object with
MSG_META_IACP_PROCESS_MESSAGE
, the Application object automatically dispatches the message to the appropriate location.
-
An Application object will refuse to quit as long as any client has an open IACP connection to it. (It can, however, be forcibly detached; this happens when the system is shut down, as noted below.). In such a case, the Application object will automatically call
IACPShutdownAll()
to shut down all IACP links it has open, whether it is a client or a server on those links.
-
When a link is closed, IACP automatically sends MSG_META_IACP_LOST_CONNECTION to all objects on the other side of the link. When an Application object receives this message, it waits until all remaining messages from the link have been handled; it then calls
IACPShutdown()
for that connection. It also forwards this message to all Document objects, so a Document object will know to close itself if the IACP connection was the only reference to it. Again, the Application object does this whether it is a client or a server.
-
If the Application object is forcibly detached, it sends itself MSG_GEN_APPLICATION_IACP_SHUTDOWN_ALL_CONNECTIONS. The default handler for this message will call
IACPShutdownAll()
to shut down all IACP links the Application object has open, whether it is a client or a server on those links. You can subclass this message if you need to take some additional action when the IACP connections are severed.
|
GEOS SDK TechDocs
|
|
6.1 IACP Overview
|
6.3 Messages Across an IACP Link