Notifying the Listener with sa_send_udp

SQL Anywhere databases include a system stored procedure called sa_send_udp that can be used to send UDP notifications to the Listener.

If you use sa_send_udp as a way to notify the Listener, you should append a 1 to your UDP packet. This number is a server-initiated synchronization protocol number. In future versions of MobiLink, new protocol versions may cause the Listener to behave differently.

See sa_send_udp system procedure.

Example

On a device, start the Listener as follows, where path is the location of your Internet Explorer program:

dblsn -v -l "message=TheMessage;action=start 'path\iexplore.exe' http://www.sybase.com"

On a different device, start a SQL Anywhere database. Start Interactive SQL, and connect to the database. Execute the following SQL. (Note that the UDP packet has a 1 appended to it.)

call SA_SEND_UDP('machine#1_ip_name',5001,'TheMessage1')

Internet Explorer opens, showing the Sybase home page.

To make this example work on a single device, use localhost as the first parameter to sa_send_udp.