Collection Contents 上一页 下一页 PDF

MobiLink 服务器启动同步用户指南

设置服务器启动的同步

监听器

存储监听器选项


一种配置监听器的简便方法是将命令行选项存储在文本文件中,然后使用 @ 符号访问该文件。例如,将设置存储在 mydblsn.txt 中,然后通过键入以下内容启动监听器

dblsn @mydblsn.txt

参数文件的路径必须完全限定。

有关配置文件的详细信息,请参见使用配置文件

如果要保护口令或配置文件中的其它信息,可以使用文件隐藏实用程序对配置文件的内容进行模糊处理。

请参见使用 dbfhide 命令行实用程序隐藏文件内容

也可以将命令行选项存储在环境变量中,并通过键入 @ 和环境变量名称在 dblsn 命令行中调用,例如 dblsn @dblsnoptions。如果您的文件名和环境变量具有相同的名称,则使用环境变量。

缺省参数文件 dblsn.txt 

如果键入 dblsn 且不带任何参数,dblsn 将使用 dblsn.txt 作为缺省参数文件。该功能对 CE 设备尤其有用。

下面是一个示例参数文件。

#---- SIS_SimpleListener\dblsn.txt --------------------------------------------
#
# This is the default argument file for dblsn.exe
#

#------------------------------------------------------------------------------
# Device name
#
-e device1

#------------------------------------------------------------------------------
# MobiLink connection parameters
#
-x host=localhost
#------------------------------------------------------------------------------
# Verbosity level 2
#
-v2

#------------------------------------------------------------------------------
# Show notification messages in console and log
#
-m

#------------------------------------------------------------------------------
# Polling interval of 1 seconds
#
-i 1
#------------------------------------------------------------------------------
# Truncate, then write output to dblsn.log
#
-ot dblsn.log

#------------------------------------------------------------------------------
# First message handler
#   - No filter, so it applies to all messages
#   - Try to send the message to the beeper utility
#   - If that fails, start the beeper utility with the message
#   - Message handling continues with the next handler
#
-l "action='socket port=12345;
            sendText=$sender:$message;
            recvText=beeperAck;
            timeout=5';
    altaction='start java.exe Beeper 12345 $sender:$message';
    continue=yes;"
   
#------------------------------------------------------------------------------
# Second message handler
#   - Only applies to messages with subject equals 'shutdown'
#   - The action is to send "shutdown" to the beeper utility
#   - Message handling continues with the next handler
#
-l "subject='shutdown';
    action='socket port=12345;
            sendText=shutdown;
            recvText=beeperAck;
            timeout=5';
    continue=yes;"
   
#------------------------------------------------------------------------------
# Third handler
#   - Only applies to messages with subject equals 'shutdown'
#   - The action is to shut down the MobiLink Listener
#
-l "subject='shutdown';
    action='DBLSN FULL SHUTDOWN';"

Collection Contents 上一页 下一页 PDF