Symbian3/SDK/Source/GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8.dita
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     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 concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8" xml:lang="en"><title>Asynchronous
       
    13 Services Example Codes</title><shortdesc>Explains how to use asynchronous requests.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <ul>
       
    15 <li id="GUID-3CEEC547-CB45-5BC4-85BE-C2DF97663BE9"><p><xref href="GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8.dita#GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8/GUID-9D95DEED-4E6A-5139-9188-DD7FA0A4B906">SingleRequest: asynchronous programming without active objects</xref>  </p> </li>
       
    16 <li id="GUID-0A475759-3571-5F7A-986C-45F93257C2CE"><p><xref href="GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8.dita#GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8/GUID-D9B89770-81F8-52ED-848E-F79A92858C37">WaitLoop: asynchronous programming without active objects</xref>  </p> </li>
       
    17 <li id="GUID-442DA981-732E-5F21-8140-A7E998099B25"><p><xref href="GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8.dita#GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8/GUID-F6C2B633-E744-5B40-819D-6615406A9664">RealLifeWaitLoop: asynchronous programming without active objects</xref>  </p> </li>
       
    18 <li id="GUID-0CC6DC14-4CE8-500E-A9BE-BF147E5BC130"><p><xref href="GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8.dita#GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8/GUID-D3EA20C0-AF5C-5AFE-8014-48CB92851463">RunComplete: asynchronous programming with active objects</xref>  </p> </li>
       
    19 <li id="GUID-5B75E3E3-4AD4-51FD-828D-0A81BF0AE087"><p><xref href="GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8.dita#GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8/GUID-802DB10F-150B-5A76-BFC8-A7E8EB4A68D6">AcceptInput1-2: asynchronous programming with active objects</xref>  </p> </li>
       
    20 <li id="GUID-2E15F495-27E3-57F6-BB79-E392237F7E8D"><p><xref href="GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8.dita#GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8/GUID-1BEA3D45-21A2-54AB-ABBD-EF23716FE6B5">AcceptPrintInput: asynchronous programming with active objects</xref>  </p> </li>
       
    21 <li id="GUID-A16AA99F-366E-5EED-85CF-7372F177EBFF"><p><xref href="GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8.dita#GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8/GUID-AD4D25CA-B0BF-54BD-8029-DD495AB56C5E">Fibonacci1-3: asynchronous programming with active objects</xref>. </p> </li>
       
    22 </ul>
       
    23 <section id="GUID-9D95DEED-4E6A-5139-9188-DD7FA0A4B906"><title>SingleRequest:
       
    24 asynchronous programming without active objects</title> <p><b>Download</b> </p> <p>Click
       
    25 on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-5649e475-b630-4411-ae06-99a03f575dbd.zip" scope="external"> SingleRequest.zip </xref></p><p>Click on the following link
       
    26 to download additional file: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.zip" scope="external"> CommonFramework.zip </xref></p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-5649e475-b630-4411-ae06-99a03f575dbd.html" scope="peer"> browse SingleRequest </xref> to view the example code.</p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.html" scope="peer"> browse CommonFramework </xref> to view the additional file.</p> <p>Click
       
    27 on the below link for S60 Example which demonstrates Asynchronous requests<xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-9f4be784-fb23-4a66-9f7f-d44b28fe98c1.zip" scope="external"> ClientServerAsync .zip</xref> .</p><p>Browse the S60 files.<xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-9f4be784-fb23-4a66-9f7f-d44b28fe98c1.html" scope="external"> ClientServerAsync </xref> .</p><p><b>Description</b> </p> <p>This
       
    28 example shows how to issue and wait for a single request. </p> <p>The example
       
    29 shows the general principles involved in asynchronous programming. It uses
       
    30 a simple wait loop and shows how the completion of asynchronous events are
       
    31 handled <i>without</i> active objects. </p> <p>This example does not use active
       
    32 objects <i>deliberately</i>. </p><p><b>Class summary</b></p><p><xref href="GUID-E0B34F3E-D4C4-3232-B8B1-7DB35B454646.dita"><apiname>TRequestStatus</apiname></xref></p> <p><b>Security
       
    33 issues</b> </p> <p>The example requires no specific capabilities in order
       
    34 to run - and does not demonstrate any security issues. </p> </section>
       
    35 <section id="GUID-D9B89770-81F8-52ED-848E-F79A92858C37"><title>WaitLoop: asynchronous
       
    36 programming without active objects</title> <p><b>Download</b> </p> <p>Click
       
    37 on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-a1802d10-4226-43b8-a616-093ecb286eff.zip" scope="external"> Waitloop.zip </xref></p><p>Click on the following link to
       
    38 download additional file: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.zip" scope="external"> CommonFramework.zip </xref></p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-a1802d10-4226-43b8-a616-093ecb286eff.html" scope="peer"> browse Waitloop </xref> to view the example code.</p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.html" scope="peer"> browse CommonFramework </xref> to view the additional file.</p> <p><b>Description</b> </p> <p>This
       
    39 example shows how a wait loop can be used to identify and handle a completed
       
    40 request. </p> <p>It shows the general principles involved in asynchronous
       
    41 programming. It uses a simple wait loop and shows how the completion of asynchronous
       
    42 events are handled <i>without</i> active objects. </p> <p>This example does
       
    43 not use active objects <i>deliberately</i>. </p><p><b>Class summary</b></p><p><xref href="GUID-E0B34F3E-D4C4-3232-B8B1-7DB35B454646.dita"><apiname>TRequestStatus</apiname></xref></p> <p><b>Security
       
    44 issues</b> </p> <p>The example requires no specific capabilities in order
       
    45 to run - and does not demonstrate any security issues. </p> </section>
       
    46 <section id="GUID-F6C2B633-E744-5B40-819D-6615406A9664"><title>RealLifeWaitLoop:
       
    47 asynchronous programming without active objects</title> <p><b>Download</b> </p> <p>Click
       
    48 on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-4d03bc9b-a832-427b-9e78-b593d3618267.zip" scope="external"> RealLifeWaitLoop.zip </xref></p><p>Click on the following
       
    49 link to download additional files:<xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.zip" scope="external"> CommonFramework.zip </xref></p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-4d03bc9b-a832-427b-9e78-b593d3618267.html" scope="peer"> browse RealLifeWaitLoop </xref> to view example code.</p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.html" scope="peer"> browse CommonFramework </xref> to view the additional file.</p> <p><b>Description</b> </p> <p>As
       
    50 with the <xref href="GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8.dita#GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8/GUID-D9B89770-81F8-52ED-848E-F79A92858C37">WaitLoop</xref> example,
       
    51 this example shows how a wait loop can be used to identify and handle a completed
       
    52 request. However, this example shows how the wait loop can deal with multiple
       
    53 asynchronous service providers. </p> <p>The example shows the general principles
       
    54 involved in asynchronous programming; it uses a simple wait loop and shows
       
    55 how the completion of asynchronous events are handled <i>without</i> active
       
    56 objects. </p> <p>This example <i>deliberately</i> does not use active objects. </p><p><b>Class
       
    57 summary</b></p><p><xref href="GUID-E0B34F3E-D4C4-3232-B8B1-7DB35B454646.dita"><apiname>TRequestStatus</apiname></xref></p> <p><b>Security issues</b> </p> <p>The
       
    58 example requires no specific capabilities in order to run - and does not demonstrate
       
    59 any security issues. </p> </section>
       
    60 <section id="GUID-D3EA20C0-AF5C-5AFE-8014-48CB92851463"><title>RunComplete:
       
    61 asynchronous programming with active objects</title> <p><b>Download</b> </p> <p>Click
       
    62 on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-0820a8bc-295c-45fb-875b-33eb81b907b8.zip" scope="external"> RunComplete.zip </xref></p><p>Click on the following link
       
    63 to download additional files:<xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.zip" scope="external"> CommonFramework.zip </xref></p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-0820a8bc-295c-45fb-875b-33eb81b907b8.html" scope="peer"> browse RunComplete </xref> to view the example code.</p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.html" scope="peer"> browse CommonFramework </xref> to view the additional file.</p> <p><b>Description</b> </p> <p>The
       
    64 example shows how active objects and an active scheduler can be used to handle
       
    65 asynchronous events. Compare this with the following examples; <xref href="GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8.dita#GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8/GUID-9D95DEED-4E6A-5139-9188-DD7FA0A4B906">SingleRequest</xref>, <xref href="GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8.dita#GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8/GUID-D9B89770-81F8-52ED-848E-F79A92858C37">WaitLoop</xref> and <xref href="GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8.dita#GUID-E63545EC-172E-53F3-B0B3-EA5150FD92D8/GUID-F6C2B633-E744-5B40-819D-6615406A9664">RealLifeWaitLoop</xref>. </p> <p>It
       
    66 demonstrates a single <codeph>CMessageTimer</codeph> active object which runs
       
    67 until completion. </p><p><b>Class summary</b></p><p> <xref href="GUID-E0B34F3E-D4C4-3232-B8B1-7DB35B454646.dita"><apiname>TRequestStatus </apiname></xref>  <xref href="GUID-B4C76104-EA1B-3FC3-A31E-86A976598171.dita"><apiname>CActiveScheduler </apiname></xref>  <xref href="GUID-067293BF-B28C-3CEC-92F4-1351A795EA7F.dita"><apiname>CActive </apiname></xref> <xref href="GUID-5733DF34-5B54-3044-BBED-3BFECB7ACE7A.dita"><apiname> CTimer</apiname></xref>  </p> <p><b>Security issues</b> </p> <p>The example
       
    68 requires no specific capabilities in order to run - and does not demonstrate
       
    69 any security issues. </p> </section>
       
    70 <section id="GUID-802DB10F-150B-5A76-BFC8-A7E8EB4A68D6"><title>AcceptInput1-2:
       
    71 asynchronous programming with active objects</title> <p><b>Download</b> </p> <p>Click
       
    72 on the following links to download the examples:</p><p><xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-16b394b8-da07-4325-aaab-2af5d07b881f.zip" scope="external"> AcceptInput1.zip</xref> </p><p><xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-7fbe04f9-1bf5-4957-a2f4-94992d0d2cc4.zip" scope="external"> AcceptInput2.zip</xref></p><p>Click on the following link
       
    73 to download additional files:<xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.zip" scope="external"> CommonFramework.zip </xref></p><p>Click on the following
       
    74 links to view the examples:</p><p><xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-16b394b8-da07-4325-aaab-2af5d07b881f.html" scope="peer"> browse AcceptInput1 </xref></p><p><xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-7fbe04f9-1bf5-4957-a2f4-94992d0d2cc4.html" scope="peer">browse AcceptInput2 </xref></p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.html" scope="peer"> browse CommonFramework </xref> to view the additional file.</p> <p><b>Description</b> </p> <p>These
       
    75 examples show how active objects and an active scheduler can be used to handle
       
    76 asynchronous events. </p> <p>They demonstrate a single <codeph>CKeyMessengerProcessor</codeph> active
       
    77 object (derived from class <codeph>CActiveConsole</codeph>), which accepts
       
    78 input from keyboard, but does not print it. This object contains a <codeph>CMessageTimer</codeph> object
       
    79 which it activates if the user inputs the character "m" and cancelled if the
       
    80 user inputs "c". </p><p><b>Class summary</b></p><p><xref href="GUID-E0B34F3E-D4C4-3232-B8B1-7DB35B454646.dita"><apiname>TRequestStatus </apiname></xref>  <xref href="GUID-B4C76104-EA1B-3FC3-A31E-86A976598171.dita"><apiname>CActiveScheduler </apiname></xref> <xref href="GUID-067293BF-B28C-3CEC-92F4-1351A795EA7F.dita"><apiname>CActive </apiname></xref> <xref href="GUID-5733DF34-5B54-3044-BBED-3BFECB7ACE7A.dita"><apiname> CTimer</apiname></xref>  </p> <p><b>Security issues</b> </p> <p>The example
       
    81 requires no specific capabilities in order to run - and does not demonstrate
       
    82 any security issues. </p> </section>
       
    83 <section id="GUID-1BEA3D45-21A2-54AB-ABBD-EF23716FE6B5"><title>AcceptPrintInput:
       
    84 asynchronous programming with active objects</title> <p><b>Download</b> </p> <p>Click
       
    85 on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-285678f7-e35c-45ae-8074-8246fb6b1e90.zip" scope="external">AcceptPrintInput.zip</xref></p><p>Click on the following
       
    86 link to download additional files: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.zip" scope="external">CommonFramework.zip</xref></p><p>View the source code<xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-285678f7-e35c-45ae-8074-8246fb6b1e90.html" scope="peer"> browse AcceptPrintInput</xref>. View the additional file: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.html" scope="peer">browse CommonFramework</xref>.</p> <p><b>Description</b> </p> <p>This
       
    87 example demonstrates how to accept and print keyboard input to a console using
       
    88 active objects. </p> <p>The example implements a class called <codeph>CWriteKeyProcessor</codeph> which
       
    89 is an active object that requests and handles keyboard input in its <codeph>ProcessKeyPress()</codeph> method.
       
    90 An alphabetic or space character is printed as a character, anything else
       
    91 is printed as an integer. Pressing the escape key terminates the application. </p><p><b>Class
       
    92 summary</b></p><p> <xref href="GUID-B4C76104-EA1B-3FC3-A31E-86A976598171.dita"><apiname>CActiveScheduler </apiname></xref><xref href="GUID-067293BF-B28C-3CEC-92F4-1351A795EA7F.dita"><apiname>CActive </apiname></xref> <xref href="GUID-5733DF34-5B54-3044-BBED-3BFECB7ACE7A.dita"><apiname>CTimer</apiname></xref>  </p> <p><b>Security
       
    93 issues</b> </p> <p>The example requires no specific capabilities in order
       
    94 to run - and does not demonstrate any security issues. </p> </section>
       
    95 <section id="GUID-AD4D25CA-B0BF-54BD-8029-DD495AB56C5E"><title>Fibonacci1-3:
       
    96 asynchronous programming with active objects</title> <p><b>Download</b> </p> <p>Click
       
    97 on the following links to download the examples: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-a87ca9bc-77dd-43b0-8e38-d16a454e2c6e.zip" scope="external"> Fibonacii1.zip </xref></p><p><xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-1f2ee4ff-787b-4240-b912-aa02651f823c.zip" scope="external">Fibonacii2.zip </xref></p><p><xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-a0979da8-ff45-4aa0-b0e0-5cc518ec328c.zip" scope="external">Fibonacii3.zip </xref></p><p>Click <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-a87ca9bc-77dd-43b0-8e38-d16a454e2c6e.html" scope="peer"> browse  Fibonacii1 </xref></p><p><xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-1f2ee4ff-787b-4240-b912-aa02651f823c.html" scope="peer">browse Fibonacii2</xref></p><p><xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-a0979da8-ff45-4aa0-b0e0-5cc518ec328c.html" scope="peer">browse Fibonacii3</xref></p> <p><b>Description</b> </p> <p>These
       
    98 examples show how active objects and an active scheduler can be used to handle
       
    99 asynchronous events and long-running services to maintain system responsiveness. </p><p><b>Class
       
   100 summary</b></p><p><xref href="GUID-E0B34F3E-D4C4-3232-B8B1-7DB35B454646.dita"><apiname>TRequestStatus </apiname></xref> <xref href="GUID-B4C76104-EA1B-3FC3-A31E-86A976598171.dita"><apiname> CActiveScheduler </apiname></xref> <xref href="GUID-067293BF-B28C-3CEC-92F4-1351A795EA7F.dita"><apiname>CActive </apiname></xref> <xref href="GUID-5733DF34-5B54-3044-BBED-3BFECB7ACE7A.dita"><apiname> CTimer</apiname></xref>  </p> <p><b>Security issues</b> </p> <p>The example requires no specific capabilities
       
   101 in order to run - and does not demonstrate any security issues. </p> </section>
       
   102 </conbody></concept>