Symbian3/SDK/Source/GUID-D0FEE812-AD80-40D8-B902-05EC16C44C42.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
child 13 48780e181b38
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="GUID-D0FEE812-AD80-40D8-B902-05EC16C44C42" xml:lang="en"><title>Opening
a Connection to an IAP</title><shortdesc>Extended Connection Preferences API can be used by applications
to set the preferred Internet Access Point (IAP) prior to establishing a connection.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
<context id="GUID-707C9659-1FAE-418E-88D7-1E62C0D7A7E1">       <p>Specifying
IAP ID enables the applications to start a connection to a specific IAP. The
application acquires a connection to the requested IAP, regardless of the
existing connections.</p> </context>
<steps id="GUID-4DD07DEC-6017-4237-BE46-1D69E5FBD744-GENID-1-10-1-14-1-1-4-1-1-5-1-1-5-1-3-2">
<step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-10-1-14-1-1-4-1-1-5-1-1-5-1-3-2-1"><cmd>Connect to<xref href="GUID-1277D793-4A0A-50A7-9414-AEE93E906E80.dita"> socket server </xref>.</cmd>
<info> <codeblock xml:space="preserve">RSocketServ ss;
ss.Connect();       </codeblock>                 </info>
</step>
<step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-10-1-14-1-1-4-1-1-5-1-1-5-1-3-2-2"><cmd> Open a <xref href="GUID-BD8446C5-3ADE-59A6-A13A-A5482D6FC56F.dita"> RConnection </xref> object.</cmd>
<info> <codeblock xml:space="preserve">RConnection conn;
conn.Open( ss );</codeblock>                  </info>
</step>
<step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-10-1-14-1-1-4-1-1-5-1-1-5-1-3-2-3"><cmd>Create a connection
preference list and extended connection preferences object.</cmd>
<info> <codeblock xml:space="preserve">TConnPrefList prefList;
TExtendedConnPref preferences;   </codeblock>                  </info>
</step>
<step id="GUID-A2DF22F2-7FB2-43EE-9DC6-A87BFB47B23F"><cmd>Define the IAP using <xref href="GUID-B78E8AC0-CDC8-3DEC-AF3C-98C8994DA34A.dita#GUID-B78E8AC0-CDC8-3DEC-AF3C-98C8994DA34A/GUID-D81D45EE-CA3C-3CB1-83EE-2EA313807AF4"><apiname>TExtendedConnPref::SetIapId()</apiname></xref>. </cmd>
<info><codeblock xml:space="preserve">preferences.SetIapId( 8 );</codeblock></info>
</step>
<step id="GUID-65E4E92C-BDA3-4E95-8797-9A4E9A829B5D"><cmd>Append extended
connection preferences into connection preference list. </cmd>
<info><codeblock xml:space="preserve">prefList.AppendL( &amp;preferences );</codeblock></info>
</step>
<step id="GUID-7B2046C2-1F25-46C9-BDD8-66168AC52034"><cmd>Start a connection
with connection preferences.</cmd>
<info><codeblock xml:space="preserve">conn.Start( prefList );</codeblock></info>
</step>
</steps>
<result id="GUID-705D9124-7F06-4305-B9A7-BE59A5052977">       <p>The application
is connected to the specified IAP.</p>     </result>
</taskbody><related-links>
<link href="GUID-3490A064-8421-4ABB-9E93-99A5565CF4D7.dita"><linktext>Additional
Connection Preferences</linktext></link>
</related-links></task>