Ultra Light では、設定されている通信ストリーム (ネットワークプロトコル) で Mobile Link サーバーとの特定の接続を開始することで同期が開始されます。ネットワークに直接接続している場合の同期のサポートに加えて、Windows
Mobile デバイスでは ActiveSync 同期もサポートされています。
各 Ultra Light リモートデータベースは、ネットワークプロトコルによって Mobile Link サーバーと同期します。ネットワークプロトコルは同期ストリームパラメーターを使用して設定します。サポートされているネットワークプロトコルには、TCP/IP、HTTP、HTTPS、TLS
があります。選択するプロトコルについて、Mobile Link サーバーのホストやポートなどその他の必要な接続情報を定義するストリームパラメーターを指定する必要があります。また、Mobile Link ユーザー情報と同期スクリプトのバージョンも指定してください。
たとえば、C/C++ API を使用する場合は、ul_sync_info 構造体に適切な値を設定して、Ultra Light アプリケーションに同期を追加します。
ul_sync_info info;
// define a sync structure named "info"
ULEnableTcpipSynchronization( &sqlca );
// use a TCP/IP stream
conn->InitSynchInfo( &info );
// initialize the structure
info.stream = ULSocketStream();
// specify the Socket Stream
info.stream_parms= UL_TEXT( "host=myMLserver;port=2439" );
// set the MobiLink host information
info.version = UL_TEXT( "custdb 11.0" );
// set the MobiLink version information
info.user_name = UL_TEXT( "50" );
// set the MobiLink user name
info.download_only =ul_true;
// make the synchronization download-only