home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_06.cab / samp3f72.asp < prev    next >
Text File  |  1997-09-29  |  3KB  |  38 lines

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp3f72.asp&srcfile=Interaction/Cancel" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  3. <HTML>
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
  6. <title>Client Connection</title>
  7. <script language="JavaScript">
  8.  
  9.     szNavVersion = navigator.appVersion
  10.  
  11.     if (navigator.appName == "Microsoft Internet Explorer") {
  12.     if (szNavVersion.indexOf ("4.") >= 0) {
  13.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  14.     } else {
  15.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  16.     }
  17.     }
  18.     else if (navigator.appName == "Netscape") {
  19.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  20.     }
  21.     else {
  22.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  23.     }
  24.  
  25. </script>
  26. <META NAME="DESCRIPTION" CONTENT="Internet Information Server reference information"></HEAD>
  27. <BODY BGCOLOR=#FFFFFF TEXT=#000000>
  28. <font face="Verdana, Arial, Helvetica">
  29. <h3><a name="_client_connection"></a>Client Connection</h3>
  30. <p>
  31. If your Web-based application performs complicated or time-consuming calculations or procedures, it is often useful for it to periodically check-in with the client browser and confirm that they are, indeed, still connected to the server. For instance, an on-line catalog application could check the client browser's connection before and after performing each computationally-intensive operation, such as creating an individual catalog item page from a database, or generating a purchasing invoice. If at any time it discovers that the connection has been abandoned, the application can destroy the session and state information, and devote the server's resources to other tasks.</p>
  32. <p>
  33. This sample simulates an application that performs time-consuming calculations. A message is sent to the client browser that the application is about to perform a time-consuming operation, which in this case is simply a large loop. After the operation, the script checks the <b>Response.IsClientConnected</b> property to determine whether the client browser is still connected. If they are still connected, another time-consuming loop is performed, followed by another <b>Response.IsClientConnected</b> check. If the client browser remains connected, the user is rewarded with a thank you message.</p>
  34. <hr class="iis" size="1">
  35. <p align="center"><em><a href="/iishelp/common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
  36. </BODY>
  37. </HTML>
  38.