Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » MobiLink - 服务器启动的同步 » 用于 Palm 设备的 MobiLink 监听器 C API

 

PalmLsnProcess 方法

根据配置数据库中的记录处理消息。

语法
palm_lsn_ret PalmLsnProcess(
    struct a_palm_msg * msg,
    Char const * configPDBName,
    UInt16 * const problematicRecNum,
    Boolean * handled
)
参数
  • msg   指向 a_palm_msg 实例的指针。

  • configPDBName   包含配置数据库名称的字符数组。使用 PalmLsnGetConfigFileName 方法获取配置数据库名称。请参见PalmLsnGetConfigFileName 方法

  • problematicRecNum   标识配置数据库中有问题或格式有误的记录的索引的输出参数。

  • handled   指示 PalmLsnProcess 是否成功处理消息的输出参数。

返回值

palm_lsn_ret 枚举中定义的返回代码。请参见palm_lsn_ret 枚举

注释

PalmLsnProcess 确定针对进来的消息采取相应的操作。它比较消息的字段与配置数据库中存储的过滤器。

有关创建监听器配置数据库的详细信息,请参见用于 Palm 设备的监听器配置实用程序

配置数据库中包含的记录存储有关消息过滤器以及针对接收的消息应采取哪些操作的信息。

配置记录具有以下格式:

[subject=<string>;] [content=<string>;]
[message|message_start=<string>;] [sender=<string>;]
action=run <app name> [arguments]

arguments 是可以包含操作变量的与应用程序相关的字符串。

另请参见
示例

以下是处理消息使用的部分列表。此示例分配消息结构、初始化字段并使用 PalmLsnProcess 处理消息:

a_palm_msg * ulMsg;
Boolean * handled 
Char configDb[dmDBNameLength];
...

// Allocate the message structure
ulMsg = PalmLsnAllocate();
...

// Fill the message fields
ret = PalmLsnDupMessage(ulMsg, msgBody);
...

// Get the configuration database name
PalmLsnGetConfigFileName(configDb);

// Process the message
ret = PalmLsnProcess(ulMsg, configDb, NULL, handled);
...

// Free the message
PalmLsnFree(ulMsg);