一种配置监听器的简便方法是将命令行选项存储在文本文件中,然后使用 @ 符号访问该文件。例如,将设置存储在 mydblsn.txt 中,然后通过键入以下内容启动监听器
dblsn @mydblsn.txt
参数文件的路径必须完全限定。
有关配置文件的详细信息,请参见使用配置文件。
如果要保护口令或配置文件中的其它信息,可以使用文件隐藏实用程序对配置文件的内容进行模糊处理。
也可以将命令行选项存储在环境变量中,并通过键入 @ 和环境变量名称在 dblsn 命令行中调用,例如 dblsn @dblsnoptions。如果您的文件名和环境变量具有相同的名称,则使用环境变量。
如果键入 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';"SQL Anywhere Studio 9.0.2
版权所有 © 1989–2005 Sybase, Inc. 部分版权所有 © 2001–2005 iAnywhere Solutions, Inc. 保留所有权利。