Extended Connection Preferences API can be used by applications to set the SNAP ID prior to establishing a connection.
Specifying SNAP ID enables the applications to start a connection to a specific SNAP.
Connect to socket server .
RSocketServ ss; ss.Connect();
Open a RConnection object.
RConnection conn; conn.Open( ss );
Create a connection preference list and extended connection preferences object.
TConnPrefList prefList; TExtendedConnPref preferences;
Set the SNAP ID
using TExtendedConnPref::SetSnapId()
.
preference.SetSnapId( 4 );
Append the extended connection preferences to connection preference list.
prefList.AppendL( &preferences );
Start a connection with connection preferences.
conn.Start( prefList );
The application is connected to the specified SNAP ID.