|
GEOS SDK TechDocs
|
|
4 Data Formats
|
6 Application Responsibilities
A data driver specifies how the data in a transmitted message is arranged. An application that sends a message must provide it in the format required by the data driver. The data driver then translates the message into an appropriate format for the transport driver. When the transport driver receives a message, it determines which data driver can interpret the message, and then calls theMailbox library.
There are a number of default GEOS data types, and developers may write other data drivers of their own to support new data types.
A data driver has to perform a few different tasks:
-
When an application sends a message, the Mailbox library hands the message to the data driver. If the message-data is volatile, the data driver must copy the message's data to a safe place, so the application can free the storage it used to create the message. It gives the Mailbox library an opaque token to identify the message; the mailbox library will use this token when it requests the message for delivery.
-
When the Mailbox library requests it, it must provide message data (one "block" at a time) in a format appropriate for the transport driver.
-
When the Mailbox library receives a message in the driver's format, it must be able to handle data, one "block" at a time, provided by the transport driver in that driver's format; it must be able to assemble this into a message in the data driver's format. (As when transmitting a message, the data driver will give the Mailbox library an opaque token to identify this message.)
-
When it delivers a message, it must provide a reference to the received message in a format the receiving application will be able to understand.
-
The data driver must be able to provide, on request, the size of any message (outgoing or incoming) it's holding.
-
When the Mailbox library informs the data driver that a message has been handled (i.e. an outgoing message has been transmitted, or an incoming message has been deleted by the destination application), the data driver must free its copy of the message, reclaiming the space that message was using.
|
GEOS SDK TechDocs
|
|
4 Data Formats
|
6 Application Responsibilities