Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » UltraLite - C and C++ Programming » Application Development » Developing applications using Embedded SQL » Adding synchronization to your application


Setting synchronization parameters

The following code initiates TCP/IP synchronization. The MobiLink user name is Betty Best, with password TwentyFour, the script version is default, and the MobiLink server is running on the host computer test.internal, on port 2439:

ul_synch_info synch_info;
ULInitSynchInfo( &synch_info );
synch_info.user_name = UL_TEXT("Betty Best");
synch_info.password = UL_TEXT("TwentyFour");
synch_info.version = UL_TEXT("default"); = ULSocketStream();
synch_info.stream_parms =
ULSynchronize( &sqlca, &synch_info );

The following code for an application on the Palm Computing Platform is called when the user exits the application. It allows HotSync synchronization to take place, with a MobiLink user name of 50, an empty password, a script version of custdb. The HotSync conduit communicates over TCP/IP with a MobiLink server running on the same computer as the conduit (localhost), on the default port (2439):

ul_synch_info synch_info;
ULInitSynchInfo( &synch_info ); = UL_TEXT("Betty Best");
synch_info.version = UL_TEXT("default"); = ULConduitStream();
synch_info.stream_parms =
ULSetSynchInfo( &sqlca, &synch_info );