Symbian3/SDK/Source/GUID-7F6283C0-46E8-427C-B6A9-FB274A7D2C15.dita
changeset 8 ae94777fff8f
child 13 48780e181b38
equal deleted inserted replaced
7:51a74ef9ed63 8:ae94777fff8f
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE task
       
    11   PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
       
    12 <task id="GUID-7F6283C0-46E8-427C-B6A9-FB274A7D2C15" xml:lang="en"><title>Opening
       
    13 a Connection to a SNAP by specifying SNAP Type</title><shortdesc>Extended Connection Preferences API can be used by applications
       
    14 to set the SNAP type prior to establishing a connection.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
       
    15 <context id="GUID-DA2ED45B-65AC-4C82-B854-67284173FAF9-GENID-1-10-1-14-1-1-4-1-1-5-1-1-3-1-3-1">       <p>Specifying
       
    16 SNAP type enables the applications to start a connection to a specific SNAP
       
    17 (For example, Internet SNAP or Intranet SNAP) without iterating through the
       
    18 SNAP list to identify the appropriate type.</p>     </context>
       
    19 <steps id="GUID-4DD07DEC-6017-4237-BE46-1D69E5FBD744-GENID-1-10-1-14-1-1-4-1-1-5-1-1-3-1-3-2">
       
    20 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-10-1-14-1-1-4-1-1-5-1-1-3-1-3-2-1"><cmd>Connect to<xref href="GUID-1277D793-4A0A-50A7-9414-AEE93E906E80.dita"> socket server </xref>.</cmd>
       
    21 <info> <codeblock xml:space="preserve">RSocketServ ss;
       
    22 ss.Connect();       </codeblock>                  </info>
       
    23 </step>
       
    24 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-10-1-14-1-1-4-1-1-5-1-1-3-1-3-2-2"><cmd> Open a<xref href="GUID-BD8446C5-3ADE-59A6-A13A-A5482D6FC56F.dita"> RConnection </xref> object.</cmd>
       
    25 <info> <codeblock xml:space="preserve">RConnection conn;
       
    26 conn.Open( ss );</codeblock>                  </info>
       
    27 </step>
       
    28 <step id="GUID-DC3652D1-7EDB-4582-8B6B-117E248A1F70-GENID-1-10-1-14-1-1-4-1-1-5-1-1-3-1-3-2-3"><cmd>Create a connection
       
    29 preference list and extended connection preferences object.</cmd>
       
    30 <info> <codeblock xml:space="preserve">TConnPrefList prefList;
       
    31 TExtendedConnPref preferences;    </codeblock>                  </info>
       
    32 </step>
       
    33 <step id="GUID-3D1BD3F8-6244-45E9-AF47-C19E5667092C-GENID-1-10-1-14-1-1-4-1-1-5-1-1-3-1-3-2-4"><cmd>Set the SNAP type
       
    34 using <xref href="GUID-B78E8AC0-CDC8-3DEC-AF3C-98C8994DA34A.dita#GUID-B78E8AC0-CDC8-3DEC-AF3C-98C8994DA34A/GUID-D26E7C3A-0C40-3BF1-85E4-6D28044F356B"><apiname>TExtendedConnPref::SetSnapPurpose()</apiname></xref>.</cmd>
       
    35 <info><codeblock xml:space="preserve">preferences.SetSnapPurpose( CMManager::ESnapPurposeInternet );</codeblock></info>
       
    36 </step>
       
    37 <step id="GUID-9DE0CAE0-8F0A-4197-9FC1-B045C32A817F-GENID-1-10-1-14-1-1-4-1-1-5-1-1-3-1-3-2-5"><cmd>Append the extended
       
    38 connection preferences into connection preference list. </cmd>
       
    39 <info><codeblock xml:space="preserve">prefList.AppendL( &amp;preferences );</codeblock></info>
       
    40 </step>
       
    41 <step id="GUID-E492622A-4410-4F2D-A4DC-C0D8A3B33F99-GENID-1-10-1-14-1-1-4-1-1-5-1-1-3-1-3-2-6"><cmd>Start a connection
       
    42 with connection preferences.</cmd>
       
    43 <info><codeblock xml:space="preserve">conn.Start( prefList );</codeblock></info>
       
    44 </step>
       
    45 </steps>
       
    46 <result id="GUID-3B2081B8-6F9D-40C1-8407-0F0EB43790B5-GENID-1-10-1-14-1-1-4-1-1-5-1-1-3-1-3-3">       <p>The application
       
    47 is connected to Internet SNAP.</p>     </result>
       
    48 </taskbody><related-links>
       
    49 <link href="GUID-3490A064-8421-4ABB-9E93-99A5565CF4D7.dita"><linktext>Additional
       
    50 Connection Preferences</linktext></link>
       
    51 </related-links></task>