[boost-doc-zh] r295 committed - [No log message]

  • From: codesite-noreply@xxxxxxxxxx
  • To: boost-doc-zh-notify@xxxxxxxxxxxxx
  • Date: Tue, 25 Aug 2009 05:15:22 +0000

Revision: 295
Author: totti19851101
Date: Mon Aug 24 22:14:33 2009
Log: [No log message]
http://code.google.com/p/boost-doc-zh/source/detail?r=295

Modified:
 /trunk/doc/html/boost_asio/tutorial/tutdaytime2.html

=======================================
--- /trunk/doc/html/boost_asio/tutorial/tutdaytime2.html Wed May 27 03:09:50 2009 +++ /trunk/doc/html/boost_asio/tutorial/tutdaytime2.html Mon Aug 24 22:14:33 2009
@@ -1,6 +1,6 @@
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>Daytime.2 - A synchronous TCP daytime server</title>
 <link rel="stylesheet" href="../../boostbook.css" type="text/css">
 <meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
@@ -24,12 +24,10 @@
 </div>
 <div class="section" lang="en">
 <div class="titlepage"><div><div><h3 class="title">
-<a name="boost_asio.tutorial.tutdaytime2"></a><a class="link" href="tutdaytime2.html" title="Daytime.2 - A synchronous TCP daytime server"> Daytime.2 - A synchronous
-      TCP daytime server</a>
+<a name="boost_asio.tutorial.tutdaytime2"></a><a class="link" href="tutdaytime2.html" title="Daytime.2 - A synchronous TCP daytime server"> Daytime.2 - 同步TCP daytime服务器</a>
 </h3></div></div></div>
 <p>
- This tutorial program shows how to use asio to implement a server application
-        with TCP.
+        本示例示范如何使用Asio来实现一个TCP服务器程序。
       </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">ctime</span><span class="special">&gt;</span> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
@@ -39,8 +37,7 @@
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">ip</span><span class="special">::</span><span class="identifier">tcp</span><span class="special">;</span>
 </pre>
 <p>
- We define the function <code class="computeroutput"><span class="identifier">make_daytime_string</span><span class="special">()</span></code> to create the string to be sent back to - the client. This function will be reused in all of our daytime server applications. + 我们先定义一个<code class="computeroutput"><span class="identifier">make_daytime_string</span><span class="special">()</span></code>来产生需要发送给客户端的字符串.这个函数会在 我们所有的daytime服务器上被使用。
       </p>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">make_daytime_string</span><span class="special">()</span>
 <span class="special">{</span>
@@ -56,16 +53,13 @@
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">io_service</span> <span class="identifier">io_service</span><span class="special">;</span>
 </pre>
 <p>
- A <a class="link" href="../reference/ip__tcp/acceptor.html" title="ip::tcp::acceptor">ip::tcp::acceptor</a> - object needs to be created to listen for new connections. It is initialised
-        to listen on TCP port 13, for IP version 4.
+ 新建一个<a class="link" href="../reference/ip__tcp/acceptor.html" title="ip::tcp::acceptor">ip::tcp::acceptor</a>
+        对象来监听新的连接。该对象应遵守IPv4协议,监听TCP端口13。
       </p>
<pre class="programlisting"> <span class="identifier">tcp</span><span class="special">::</span><span class="identifier">acceptor</span> <span class="identifier">acceptor</span><span class="special">(</span><span class="identifier">io_service</span><span class="special">,</span> <span class="identifier">tcp</span><span class="special">::</span><span class="identifier">endpoint</span><span class="special">(</span><span class="identifier">tcp</span><span class="special">::</span><span class="identifier">v4</span><span class="special">(),</span> <span class="number">13</span><span class="special">));</span>
 </pre>
 <p>
- This is an iterative server, which means that it will handle one connection - at a time. Create a socket that will represent the connection to the client,
-        and then wait for a connection.
+ 这是一个iterative server,也就是说同一时间只能处理一个连接。建立一个 表示与客户端的连接的socket, 然后等待客户端的连接。
       </p>
<pre class="programlisting"> <span class="keyword">for</span> <span class="special">(;;)</span>
     <span class="special">{</span>
@@ -73,8 +67,7 @@
<span class="identifier">acceptor</span><span class="special">.</span><span class="identifier">accept</span><span class="special">(</span><span class="identifier">socket</span><span class="special">);</span>
 </pre>
 <p>
- A client is accessing our service. Determine the current time and transfer
-        this information to the client.
+        当客户端访问服务器时,获取当前时间,并传送给客户端。
       </p>
<pre class="programlisting"> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">message</span> <span class="special">=</span> <span class="identifier">make_daytime_string</span><span class="special">();</span>

@@ -85,7 +78,7 @@
   <span class="special">}</span>
 </pre>
 <p>
-        Finally, handle any exceptions.
+        最后,处理异常。
       </p>
<pre class="programlisting"> <span class="keyword">catch</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span><span class="special">&amp;</span> <span class="identifier">e</span><span class="special">)</span>
   <span class="special">{</span>
@@ -96,18 +89,16 @@
 <span class="special">}</span>
 </pre>
 <p>
- See the <a class="link" href="tutdaytime2/src.html" title="Source listing for Daytime.2">full source listing</a> + 查看<a class="link" href="tutdaytime2/src.html" title="Source listing for Daytime.2">本例的全部源代码</a>
       </p>
 <p>
- Return to the <a class="link" href="../tutorial.html" title="Tutorial">tutorial index</a> + 返回<a class="link" href="../tutorial.html" title="Tutorial">指南 </a>
       </p>
 <p>
- Previous: <a class="link" href="tutdaytime1.html" title="Daytime.1 - A synchronous TCP daytime client">Daytime.1 - A synchronous
-        TCP daytime client</a>
+ 前一例: <a class="link" href="tutdaytime1.html" title="Daytime.1 - A synchronous TCP daytime client">Daytime.1 - 同步TCP daytime客户端</a>
       </p>
 <p>
- Next: <a class="link" href="tutdaytime3.html" title="Daytime.3 - An asynchronous TCP daytime server">Daytime.3 - An asynchronous
-        TCP daytime server</a>
+ 后一例: <a class="link" href="tutdaytime3.html" title="Daytime.3 - An asynchronous TCP daytime server">Daytime.3 - 异步TCP daytime服务器</a>
       </p>
 </div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>

Other related posts:

  • » [boost-doc-zh] r295 committed - [No log message] - codesite-noreply