MobiLink Server-Initiated Synchronization User's Guide
Setting Up Server-Initiated Synchronization
The Listener runs on remote devices. It receives messages from the Notifier and processes them into actions based on message handlers that you create. A typical message handler contains filters, actions, and options.
For example, for the following Listener command line, the Listener will only start dbmlsync if it receives a message with the subject FullSync:
dblsn -l "subject='FullSync';action='run dbmlsync.exe ...'"
Following are some of the actions that you can invoke. Typically, the desired action is synchronization initiated via either dbmlsync or an UltraLite application.
Start a process.
Run a process until it completes.
Post a window message to a process that is already running.
Perform text-based communication with local or remote applications via TCP/IP with optional confirmation.
Actions can be parameterized with variables derived from the message. This provides extra flexibility in implementing dynamic options.
Normally, you only need to start up one Listener on a device. One Listener can listen on multiple channels and it can serve multiple MobiLink users on the same device. A running Listener always listens on UDP (except for Palm Listeners).
Listeners can also synchronize device tracking information back to the consolidated database. For more information, see Device tracking.
For Listener syntax and options, see The Listener utility.
For information about Palm devices, see Listeners for Palm Devices.
For dbmlsync options, see Adaptive Server Anywhere Client Synchronization Parameters.
For more information about message handlers, see Message handlers
Instead of typing dblsn options at a command prompt, it is often convenient to store them in a text file. For more information, see Storing Listener options.
The following command starts the Listener utility. It must be typed on one line.
dblsn -v2 -m -ot dblsn.log -x "host=localhost"
-l "subject=sync;action='start dbmlsync.exe
-c eng=rem1;uid=dba;pwd=sql -ot dbmlsyncOut.txt -k';"The options used in this example are:
| Option | Description |
|---|---|
| -v2 | Set verbosity to level 2 (log Listener DLL messages and action tracing). |
| -m | Log notification messages. |
| -ot | Truncate the log file and send output to it. In this case, the output file is dblsn.log. |
| -x | Specify a way to connect to the MobiLink synchronization server. This is required for device tracking and delivery confirmation. In this simple example, the only protocol options that are specified are "host=localhost". For a complete list of protocol options, see -x option. |
| -l | Specify a message handler. In this case the filter is that a message must contain the subject sync, and the action is to start dbmlsync. Three dbmlsync command line options are also provided: -c specifies a connection string to the MobiLink synchronization server for the synchronization; -ot names an output log file; and -k shuts down dbmlsync when the synchronization is complete. |
Message handlers
Storing Listener options
SQL Anywhere Studio 9.0.2
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.