在本课中,您将配置监听器,方法是将监听器选项存储在某个文本文件中,然后通过在命令行指定该文件名来运行 dblsn。
请先在 ODBC 数据源管理器中创建一个名为 SIS_CarDealer_LP_DBLSN_REM 的文件 dsn。运行以下命令,与 MobiLink 服务器同步并创建 SIS_CarDealer_LP_DBLSN_REM.rid 文件:
dbmlsync -c filedsn=SIS_CarDealer_LP_DBLSN_REM.dsn -ot dbmlsync.log -qc -e sa=on |
监听器可以使用 $remote_id 操作变量定义 MobiLink 服务器用于标识设备的轮询键。可从远程 ID 文件 SIS_CarDealer_LP_DBLSN_REM.rid 中检索到此变量,该文件是在首次与 MobiLink 服务器同步时创建的。要使用远程 ID 文件,必须与 MobiLink 服务器同步。
创建包含以下内容的文本文件 mydblsn.txt。
# Verbosity level -v2 # Show notification messages in console and log -m # Truncate, then write output to dblsn.log -ot dblsn.log # 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 filedsn=SIS_CarDealer_LP_DBLSN_REM.dsn -ot dbmlsync.log -qc -e sa=on';" # Shutdown the listener -l "poll_connect=tcpip(host=localhost); poll_notifier=CarDealerNotifier; poll_key=$remote_id.shutdown; action='DBLSN FULL SHUTDOWN';" |
保存 mydblsn.txt 文件。
启动监听器。
在命令提示符处,浏览到监听器命令文件的目录。
通过输入以下命令启动监听器:
dblsn @mydblsn.txt |
将出现一个窗口,指示监听器正在运行。
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |