Lesson 6: Configure the Listener

In this lesson, you configure the Listener by storing the Listener options in a text file, and then running dblsn with the file name specified at the command line.

To configure the Listener
  1. Run the following command to synchronize with the MobiLink server and create the SIS_CarDealer_LP_DBLSN_REM.rid file:

    dbmlsync -c filedsn=SIS_CarDealer_LP_DBLSN_REM.dsn -ot dbmlsync.log -qc -e sa=on

    The Listener can use the $remote_id action variable to define a poll key, which the MobiLink server uses to identify the device. This variable is retrieved from the remote ID file, SIS_CarDealer_LP_DBLSN_REM.rid, which is created during the initial synchronization with the MobiLink server. You must synchronize with the MobiLink server to make use of the remote ID file.

  2. Create a text file mydblsn.txt with the following contents.

    # Verbosity level
    -v2
    
    # Show notification messages in console and log
    -m
    
    # Truncate, then write output to dblsn.log
    -ot dblsn.log
    
    # Remote ID file (defining the scope of $remote_id)
    -r SIS_CarDealer_LP_DBLSN_REM.rid
    
    # Message handlers
    
    # Watch for a notification without action
    -l "poll_connect=tcpip(host=localhost);
        poll_notifier=CarDealerNotifier;
        poll_key=$remote_id.no_action;"
    
    # Signal dbmlsync to launch, sync and then shutdown
    -l "poll_connect=tcpip(host=localhost);
        poll_notifier=CarDealerNotifier;
        poll_key=$remote_id.sync;
        action='run dbmlsync.exe -c filedsn=SIS_CarDealer_LP_DBLSN_REM.dsn -ot dbmlsync.log -qc -e sa=on';"
    
    # Shutdown the listener
    -l "poll_connect=tcpip(host=localhost);
        poll_notifier=CarDealerNotifier;
        poll_key=$remote_id.shutdown;
        action='DBLSN FULL SHUTDOWN';"
  3. Save the mydblsn.txt file.

  4. Start the Listener.

    At a command prompt, navigate to the directory of your Listener command file.

    Start the Listener by entering:

    dblsn @mydblsn.txt

    A window appears indicating the Listener is running.

See also