Symbian3/SDK/Source/GUID-7FD49142-23DC-44FC-BA7D-C11E0559C8CF.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-7FD49142-23DC-44FC-BA7D-C11E0559C8CF" xml:lang="en"><title>Opening
       
    13 a Connection to a SNAP by specifying SNAP ID</title><shortdesc>Extended Connection Preferences API can be used by applications
       
    14 to set the SNAP ID prior to establishing a connection.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
       
    15 <context id="GUID-BC67F7E5-DAC2-4B2D-B9FE-C55CA4DBF845">       <p>Specifying
       
    16 SNAP ID enables the applications to start a connection to a specific SNAP.</p> 
       
    17   </context>
       
    18 <steps id="GUID-4DD07DEC-6017-4237-BE46-1D69E5FBD744-GENID-1-10-1-14-1-1-4-1-1-5-1-1-4-1-3-2">
       
    19 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-10-1-14-1-1-4-1-1-5-1-1-4-1-3-2-1"><cmd>Connect to <xref href="GUID-1277D793-4A0A-50A7-9414-AEE93E906E80.dita"> socket server </xref>.</cmd>
       
    20 <info> <codeblock xml:space="preserve">RSocketServ ss;
       
    21 ss.Connect();       </codeblock>                  </info>
       
    22 </step>
       
    23 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-10-1-14-1-1-4-1-1-5-1-1-4-1-3-2-2"><cmd> Open a <xref href="GUID-BD8446C5-3ADE-59A6-A13A-A5482D6FC56F.dita"> RConnection </xref> object.</cmd>
       
    24 <info> <codeblock xml:space="preserve">RConnection conn;
       
    25 conn.Open( ss );</codeblock>                 </info>
       
    26 </step>
       
    27 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-10-1-14-1-1-4-1-1-5-1-1-4-1-3-2-3"><cmd>Create a connection
       
    28 preference list and extended connection preferences object.</cmd>
       
    29 <info> <codeblock xml:space="preserve">TConnPrefList prefList;
       
    30 TExtendedConnPref preferences;    </codeblock>                  </info>
       
    31 </step>
       
    32 <step id="GUID-0638ECC7-4D10-48EB-A0E3-45225761DDD4"><cmd>Set the SNAP ID
       
    33 using <xref href="GUID-B78E8AC0-CDC8-3DEC-AF3C-98C8994DA34A.dita#GUID-B78E8AC0-CDC8-3DEC-AF3C-98C8994DA34A/GUID-A7AD4DBA-35C6-3743-BC88-BE19ABC93036"><apiname>TExtendedConnPref::SetSnapId()</apiname></xref>.</cmd>
       
    34 <info><codeblock xml:space="preserve">preference.SetSnapId( 4 );</codeblock></info>
       
    35 </step>
       
    36 <step id="GUID-71C73AC8-81AD-4D13-889A-84FB3E99618F"><cmd>Append the extended
       
    37 connection preferences to connection preference list. </cmd>
       
    38 <info><codeblock xml:space="preserve">prefList.AppendL( &amp;preferences );</codeblock></info>
       
    39 </step>
       
    40 <step id="GUID-EF50B49C-E10A-427A-8BA4-C0ABDDF4DCC4"><cmd>	Start a connection
       
    41 with connection preferences.</cmd>
       
    42 <info><codeblock xml:space="preserve">conn.Start( prefList );</codeblock></info>
       
    43 </step>
       
    44 </steps>
       
    45 <result id="GUID-1917764D-20B0-4FEE-B10B-62902CC90287">       <p>The application
       
    46 is connected to the specified SNAP ID.</p>     </result>
       
    47 </taskbody><related-links>
       
    48 <link href="GUID-3490A064-8421-4ABB-9E93-99A5565CF4D7.dita"><linktext>Additional
       
    49 Connection Preferences</linktext></link>
       
    50 </related-links></task>