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

SQL Anywhere 12.0.1 » MobiLink - 服务器启动的同步 » 服务器启动的同步教程 » 教程:使用轻量级轮询配置服务器启动的同步

 

第 7 课:配置 MobiLink 监听器

本课假定您已完成前面的所有课程。 请参见第 1 课:建立统一数据库

在本课中,您将配置 MobiLink 监听器,方法是将 MobiLink 监听器选项存储在某个文本文件中,然后通过在命令行指定该文件名来运行 dblsn。

 ♦ 配置 MobiLink 监听器
  1. 请先在 ODBC 数据源管理器中创建一个名为 SIS_CarDealer_LP_DBLSN_REM 的文件 dsn。运行以下命令,与 MobiLink 服务器同步并创建 SIS_CarDealer_LP_DBLSN_REM.rid 文件:

    dbmlsync -c "SERVER=SIS_CarDealer_LP_DBLSN_REM;UID=DBA;PWD=sql" -e sa=on -o rem1.txt -v+

    MobiLink 监听器可以使用 $remote_id 操作变量定义 MobiLink 服务器用于标识设备的轮询键。可从远程 ID 文件 SIS_CarDealer_LP_DBLSN_REM.rid 中检索到此变量,该文件是在首次与 MobiLink 服务器同步时创建的。要使用远程 ID 文件,必须与 MobiLink 服务器同步。

  2. 在 SQL Anywhere MobiLink 客户端窗口中单击 [关闭]。

  3. 新建一个包含以下内容的文本文件:



    # Verbosity level
    -v2
    
    # Show notification messages in console and log
    -m
    
    # Truncate, then write output to dblsn.txt
    -ot dblsn.txt
    
    # Remote ID file (defining the scope of $remote_id)
    -r SIS_CarDealer_LP_DBLSN_REM.rid
    
    # Message handlers
    
    # Watch for a notification without action
    -l "poll_connect='tcpip(host=localhost)';
        poll_notifier=CarDealerNotifier;
        poll_key=$remote_id.no_action;"
    
    # Signal dbmlsync to launch, sync and then shutdown
    -l "poll_connect='tcpip(host=localhost)';
        poll_notifier=CarDealerNotifier;
        poll_key=$remote_id.sync;
        action='run dbmlsync.exe -c SERVER=SIS_CarDealer_LP_DBLSN_REM;UID=DBA;PWD=sql -e sa=on -o rem1.txt -v+';"
    
    # Shutdown the MobiLink Listener
    -l "poll_connect='tcpip(host=localhost)';
        poll_notifier=CarDealerNotifier;
        poll_key=$remote_id.shutdown;
        action='DBLSN FULL SHUTDOWN';"
  4. 此教程将 c:\MLsis 假定为服务器端组件的工作目录。在此目录中将文本文件另存为 mydblsn.txt

  5. 启动 MobiLink 监听器。

    在命令提示符处,浏览到 MobiLink 监听器命令文件的目录。

    通过输入以下命令启动 MobiLink 监听器:

    dblsn @mydblsn.txt

    随即出现 [Windows 版 MobiLink 监听器] 窗口,指示 MobiLink 监听器正处于休眠状态。

  6. 前进至第 8 课:发出推式请求

 另请参见