Contents Index Set up the Listener Default parameters file dblsn.txt

MobiLink Synchronization User's Guide
  Server-Initiated Synchronization
    Set up the Listener

The Listener utility


Configures and starts the Listener on Windows devices, including Windows CE.

Syntax 

dblsn [ options ] -l message-handler [ -l message-handler... ]

message-handler : [ filter;...];action

filter :
message = string | message_start = string ]
sender = string ]

action :
  action = command[;altaction = command ]
;continue = { yes | no } ]
;maydial = { yes | no } ]

command :
{  start program [ program-arguments ]
  | run program [ program-arguments ]
  | post window-message to window-class 
  | tcpip-socket-action
  | DBLSN FULL SHUTDOWN }

tcpip-socket-action :
socket port=app-port
  [ ;host=app-host ]
  [ ;sendText=text1 ]
  [ ;recvText= text2 [ ;timeout=num-sec ] ]

Parameters 

Options    The following options can be used to configure the Listener. If you are creating a configuration file for a Palm device, you must use -n. The rest are optional.

dblsn options Description
-a option Specifies Listener dll options. To specify multiple options, repeat -a. For example, -a port=2439 -a ShowSenderPort. To see options for your dll, type:

dblsn -d filename.dll -a ?

The default dll is lsn_udp.dll.

-d filename Specifies the Listener dll that you want to use. On Windows you can specify lsn_swi510.dll. The default is lsn_udp.dll.
-i seconds Sets the polling interval in seconds. This is the frequency at which the Listener listens for messages. The default is 30 seconds.
-m Turns on message logging. The default is off.
-n [ filename ] Creates a Palm Listener configuration file. If you use -n, dblsn generates the file and then shuts down. When you use -n, options such as -a, -d, -i, -m, and -p are ignored. If you use -n but omit the filename, the Palm configuration file is called lsncfg.pdb.
-o filename Logs output messages to a file.
-os bytes Specifies a maximum size for the log file in bytes. The minimum size is 10 000. By default, there is no limit.
-ot filename Logs output messages to file, but first truncates the file.
-p Allows automatic idle power-off. This option has an effect only on CE devices. Use it to allow the device to shut down when idle. By default, the Listener prevents the device from shutting itself down.
-q Runs in a minimized window.
-r bytes Specifies the minimum number of bytes per record in the Palm Listener configuration file. The default is 1 000.
-v [ level ] Sets the verbosity level for the dblsn log and console. The level can be 0, 1, 2, or 3:
  • 0 - show no informational messages (the default).

  • 1 - show Listener dll messages and basic action tracing steps.

  • 2 - show level 1 plus detailed action tracing steps.

  • 3 - show level 2 plus polling and listening states.

-l message-handler    -l allows you to specify a message handler, which is a filter-action pair. The filter determines which message should be handled, and the action is invoked when the filter matches a message. You can specify multiple instances of -l. Each instance of -l specifies a different message handler.

Filters    You specify a filter to compare to an incoming message. If the filter matches, the action you specify is invoked.

There are three types of filter you can specify:

The filter is optional. If you do not specify a filter, the action is performed when any message is received.

Action and altaction    Each filter is associated with an action and, optionally, an alternative action called the altaction. If a message meets the conditions of the filter, the action is invoked. You must specify an action. If you specify an altaction, the altaction is invoked only if the action fails. Palm devices do not recognize altaction.

The action and altaction are specified as { action | altaction }= command. For each action and altaction, there can be one command, and it can be one of start, run, post, socket, or DBLSN FULL SHUTDOWN.

You can also specify the following action options:

The escape character for action and altaction is a dollar sign ($), so to specify a single dollar sign as plain text, type $$.

The Listener determines that an action has failed (and then invokes the altaction) in the following ways:

You can only specify one action and one altaction in each instance of -l. You can also write a cover program or batch file that contains multiple actions, and run it as the action.

Following is an example of the specification of altaction. In this example, the $message_end that matches the filter is the stream parameter for connecting to MobiLink. The primary action is to post the dbas_synchronize Windows message to the dbmlsync_FullSync window. The example uses altaction to start (not run) dbmlsync with the window class name dbmlsync_FullSync if the primary action fails. This is the standard way to make the Listener work with dbmlsync scheduling.

-l "message_start=[sync];
    action='post dbas_synchronize to dbmlsync_FullSync';
    altaction='start dbmlsync.exe 
                        @dbmlsync.txt
                 -wc dbmlsync_FullSync
                 -e adr=$message_end;sch=INFINITE'"
Action variables 

The following Listener action variables can be used anywhere in the action or altaction.

An action variable is replaced just before the action or altaction is performed.

Listener action variables start with a dollar sign ($). The escape character is also a dollar sign, so to specify a dollar sign as plain text, type $$. For example, type $$message_start when you don't want $message_start to be substituted.

Action variable Description
$sender The sender of the message.
$message_start A portion of the text of the message from the beginning, as specified in -l message_start. This variable is only available if you have specified -l message_start.
$message The content of the message.
$message_end The part of the message that is left over after the part specified in -l message_start is removed. This variable is only available if you have specified -l message_start.
$year The meaning of this variable is carrier library dependent. Not available on Palm.
$month The meaning of this variable is carrier library dependent. Values can be from 1-12. Not available on Palm.
$day The meaning of this variable is carrier library dependent. Values can be from 1-31. Not available on Palm.
$hour The meaning of this variable is carrier library dependent. Values can be from 0-23. Not available on Palm.
$minute The meaning of this variable is carrier library dependent. Values can be from 0-59. Not available on Palm.
$second The meaning of this variable is carrier library dependent. Values can be from 0-59. Not available on Palm.
$type The meaning of this variable is carrier library dependent. Not available on Palm.
$priority The meaning of this variable is carrier library dependent. Not available on Palm.
$time Palm only. This is the current time in seconds since 12:00 AM, January 1, 1904.

Default parameters file dblsn.txt

Contents Index Set up the Listener Default parameters file dblsn.txt