Collection Contents Previous Next PDF

MobiLink Server-Initiated Synchronization User's Guide

The Listener

The Listener utility


The Listener utility, dblsn, configures and starts the Listener on Windows devices, including Windows CE.

This section is a detailed reference of the Listener utility. For usage information, see Listeners.

For information about Palm devices, see Listeners for Palm Devices.

Syntax 

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

message-handler : 
 [ filter;... ]action
 [ ;continue = yes ]
 [ ;maydial = no ]
 [ ;confirm_delivery = no ]

filter :
 [ subject = string ]
 [ content = string ]
 [ message = string | message_start = string ]
 [ sender = string ]

action :
  action = command[;altaction = command ]

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

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

window-message : string | message-id

Parameters 

Options    The following options can be used to configure the Listener. They are all optional.

dblsn options Description
@data Reads options from the specified environment variable or configuration file. If both exist, the environment variable is used. See Storing Listener options.
-a option Specifies a Listener DLL option. If you specify multiple -d options, each -a is for the -d option it follows.

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 ? or see Listening libraries.

-d filename Specifies the Listener dll that you want to use. The default dll is lsn_udp.dll.

For SMTP gateways, there are several dll's that you can specify. For a list, see Listening libraries.

You can also create a custom Listener library. See MobiLink Listener SDKs.

To enable multi-channel listening, specify multiple dlls by repeating -d. After each -d option, specify the -a and -i options that relate to the dll. For example,

dblsn.exe -d lsn_udp.dll -i 10 -d maac750.dll -i 60

-e device-name Specifies the device name. By default, the device name is automatically extracted from the system. If you do not use -e, you must ensure that all devices have unique names.
-f string Specifies extra information about the device. By default, this information is the operating system version. Using this option will override the default value.
-g Stop tracking UDP addresses when -x is used. This is useful when you do not want device tracking but you do want delivery confirmation.
-i seconds Sets the polling interval in seconds for SMTP connections. This is the frequency at which the Listener checks for messages. If you use multiple -d options, each -i setting is for the -d it follows. The default for SMTP is 30 seconds. For UDP connections, the Listener attempts to connect immediately.
-m Turns on message logging. The default is off.
-o filename Logs output to a file. If -o is not used, output is logged to the console window.
-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 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 so that Listening may continue.
-q Runs in a minimized window.
-t {+|-} ml_user_alias Register remote databases for notification so that you can address the remote database by name when using device tracking.

See Listener options for device tracking.

-u Listener_name Specifies a unique name for this Listener. This name is used for uploading tracking information and delivery confirmation, and can also be used as a notification address for the DeviceTracker gateway.

The Listener_name is a MobiLink user name. Like other MobiLink user names, it must be unique and you must add it to the ml_user MobiLink system table on your consolidated database. For more information, see Creating MobiLink users.

The default Listener name is device-name-dblsn.

See Listener options for device tracking.

-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.

To output notification messages, you must also use -m (see above).
-w password Specifies a password for the Listener_name.

See Listener options for device tracking.

-x {http|tcpip} [(keyword=value;...)] Specifies the network protocol and protocol options for the MobiLink synchronization server. For a list of protocol options, see -x option. This information is required for the Listener to send device tracking information and delivery confirmation to the consolidated database.

See Listener options for device tracking.

-y new_password Specifies a new MobiLink password for the Listener name. If your authentication system allows remote devices to change their passwords, this option lets them send up the new password.

See Listener options for device tracking.

Message-handlers    The -l option allows you to specify a message handler, which is a filter-action pair. The filter determines which messages 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 for each incoming message. Message handlers are processed in the order they are specified.

You can also specify the following options for message handlers:

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

The filter is optional. If you do not specify a filter, the action is performed when any message is received. This is useful when debugging or when you want a catch-all message handler as the last message handler.

For information about using the subject or content filters, see Using subject and content filters.

For information about using the message, message_start, or sender filters, see Using the filters message, message_start, and sender.

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.

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 only specify one action and one altaction in each instance of -l. If you want an action to perform multiple tasks, you can write a cover program or batch file that contains multiple actions, and run it as a single action.

Following is an example of altaction. In this example, $content is the protocol option 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 "subject=sync;
    action='post dbas_synchronize to dbmlsync_FullSync';
    altaction='start dbmlsync.exe 
                        @dbmlsync.txt
                 -wc dbmlsync_FullSync
                 -e adr=$content;sch=INFINITE'"
See also 

Listeners


Action variables
Listening libraries

Collection Contents Previous Next PDF