<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>庆亮的博客-webgame架构 &#187; erlang tcp io</title>
	<atom:link href="http://www.qingliangcn.com/tag/erlang-tcp-io/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.qingliangcn.com</link>
	<description>关注LAMP&#124;PHP源代码分析&#124;web架构&#124;PHP扩展&#124;Erlang&#124;服务端架构</description>
	<lastBuildDate>Fri, 10 Jun 2011 04:10:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>erlang tcp发包速度测试</title>
		<link>http://www.qingliangcn.com/2010/02/erlang-tcp%e5%8f%91%e5%8c%85%e9%80%9f%e5%ba%a6%e6%b5%8b%e8%af%95/</link>
		<comments>http://www.qingliangcn.com/2010/02/erlang-tcp%e5%8f%91%e5%8c%85%e9%80%9f%e5%ba%a6%e6%b5%8b%e8%af%95/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 08:34:57 +0000</pubDate>
		<dc:creator>庆亮</dc:creator>
				<category><![CDATA[Erlang]]></category>
		<category><![CDATA[erlang tcp io]]></category>

		<guid isPermaLink="false">http://www.nd21.com/?p=216</guid>
		<description><![CDATA[&#160; 这段时间我们的项目遇到广播包的一些性能问题，想起之前看到yufeng老大提到的1s广播40K包的问题，我也想测试测试我们机器的IO能力。 这次仅仅测试发包的能力，采用的是一对一的方式。 测试代码： -module(socket_io_test). -export([server/0,&#160;client/1]). server()&#160;-&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;spawn(fun()&#160;-&#62;&#160;do_server()&#160;end). do_server()&#160;-&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;case&#160;gen_tcp:listen(38888,&#160;[binary,&#160;{reuseaddr,&#160;true},&#160;{active,&#160;false}])&#160;of &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{ok,&#160;ListenSocket}&#160;-&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;do_server_loop(ListenSocket); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{error,&#160;Reason}&#160;-&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;io:format(&#34;listen&#160;38888&#160;failed:&#160;~p&#34;,&#160;[Reason]) &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;end. do_server_loop(LSock)&#160;-&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;case&#160;gen_tcp:accept(LSock)&#160;of &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{ok,&#160;ClientSocket}&#160;-&#62;&#160;do_recv(ClientSocket); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{error,&#160;Reason}&#160;-&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;io:format(&#34;accept&#160;failed:&#160;~p&#34;,&#160;[Reason]) &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;end. do_recv(ClientSocket)&#160;-&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;gen_tcp:recv(ClientSocket,&#160;0), &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;do_recv(ClientSocket). client(N)&#160;-&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;case&#160;gen_tcp:connect(&#34;127.0.0.1&#34;,&#160;38888,&#160;[binary])&#160;of &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{ok,&#160;Socket}&#160;-&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;erlang:statistics(runtime), &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;erlang:statistics(wall_clock), &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;do_send(N,&#160;Socket), &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{_,&#160;T1}&#160;=&#160;erlang:statistics(runtime), &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{_,&#160;T2}&#160;=&#160;erlang:statistics(wall_clock), &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;io:format(&#34;~p&#160;~p&#34;,&#160;[T1,&#160;T2]); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{error,&#160;Reason}&#160;-&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;io:format(&#34;connect&#160;failed:&#160;~p&#34;,&#160;[Reason]) &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;end. do_send(N,&#160;Socket)&#160;-&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;lists:foreach(fun(_)&#160;-&#62;&#160;gen_tcp:send(Socket,&#160;&#60;&#60;&#34;Hello&#160;world!&#34;&#62;&#62;)&#160;end,&#160;lists:seq(1,&#160;N)). 启动服务端: socket_io_test:server(). 启动发包客户端： socket_io_test:client(100000).&#160;100000表示发包的数量，每个包的大小为12个字节，加上TCP头部，一共36字节。&#160; 测试包的数量：&#160;400000(40W) 服务器环境：&#160; Intel(R)&#160;Xeon(R)&#160;CPU&#160;&#160;&#160;E5420&#160;&#160;@&#160;2.50GHz&#160;双四核 12G内存 100M带宽独享 测试结果： runtime wall_clock -smp&#160;auto 650&#160; 1558 -smp&#160;auto&#160;+h&#160;99999 630 [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<div class="Section0">
<p class="p0" style="text-indent:36.0000pt; margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">这段时间我们的项目遇到广播包的一些性能问题，想起之前看到<font face="Courier New">yufeng</font><font face="宋体">老大提到的</font><font face="Courier New">1s</font><font face="宋体">广播</font><font face="Courier New">40K</font><font face="宋体">包的问题，我也想测试测试我们机器的</font><font face="Courier New">IO</font><font face="宋体">能力。</font></span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="text-indent:36.0000pt; margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">这次仅仅测试发包的能力，采用的是一对一的方式。</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">测试代码：<span id="more-216"></span></span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">-module(socket_io_test)</span><span style="mso-spacerun:'yes'; color:rgb(0,0,255); font-size:10.0000pt; font-family:'Courier New'; ">.</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">-export([server/</span><span style="mso-spacerun:'yes'; color:rgb(90,90,180); font-size:10.0000pt; font-family:'Courier New'; ">0</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;client/</span><span style="mso-spacerun:'yes'; color:rgb(90,90,180); font-size:10.0000pt; font-family:'Courier New'; ">1</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">])</span><span style="mso-spacerun:'yes'; color:rgb(0,0,255); font-size:10.0000pt; font-family:'Courier New'; ">.</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">server()&nbsp;-&gt;</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;spawn(</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">fun</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">()&nbsp;-&gt;&nbsp;do_server()&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">end</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">)</span><span style="mso-spacerun:'yes'; color:rgb(0,0,255); font-size:10.0000pt; font-family:'Courier New'; ">.</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">do_server()&nbsp;-&gt;</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">case</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;gen_tcp:listen(</span><span style="mso-spacerun:'yes'; color:rgb(90,90,180); font-size:10.0000pt; font-family:'Courier New'; ">38888</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;[binary,&nbsp;{reuseaddr,&nbsp;true},&nbsp;{active,&nbsp;false}])&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">of</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ok,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">ListenSocket</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">}&nbsp;-&gt;</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do_server_loop(</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">ListenSocket</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">);</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{error,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">Reason</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">}&nbsp;-&gt;</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;io:format(</span><span style="mso-spacerun:'yes'; color:rgb(188,143,143); font-size:10.0000pt; font-family:'Courier New'; ">&quot;listen&nbsp;38888&nbsp;failed:&nbsp;~p&quot;</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;[</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">Reason</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">])</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">end</span><span style="mso-spacerun:'yes'; color:rgb(0,0,255); font-size:10.0000pt; font-family:'Courier New'; ">.</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">do_server_loop(</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">LSock</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">)&nbsp;-&gt;</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">case</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;gen_tcp:accept(</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">LSock</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">)&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">of</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ok,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">ClientSocket</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">}&nbsp;-&gt;&nbsp;do_recv(</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">ClientSocket</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">);</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{error,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">Reason</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">}&nbsp;-&gt;</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;io:format(</span><span style="mso-spacerun:'yes'; color:rgb(188,143,143); font-size:10.0000pt; font-family:'Courier New'; ">&quot;accept&nbsp;failed:&nbsp;~p&quot;</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;[</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">Reason</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">])</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">end</span><span style="mso-spacerun:'yes'; color:rgb(0,0,255); font-size:10.0000pt; font-family:'Courier New'; ">.</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">do_recv(</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">ClientSocket</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">)&nbsp;-&gt;</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gen_tcp:recv(</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">ClientSocket</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(90,90,180); font-size:10.0000pt; font-family:'Courier New'; ">0</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">),</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do_recv(</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">ClientSocket</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">)</span><span style="mso-spacerun:'yes'; color:rgb(0,0,255); font-size:10.0000pt; font-family:'Courier New'; ">.</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">client(</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">N</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">)&nbsp;-&gt;</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">case</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;gen_tcp:connect(</span><span style="mso-spacerun:'yes'; color:rgb(188,143,143); font-size:10.0000pt; font-family:'Courier New'; ">&quot;127.0.0.1&quot;</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(90,90,180); font-size:10.0000pt; font-family:'Courier New'; ">38888</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;[binary])&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">of</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ok,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">Socket</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">}&nbsp;-&gt;</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;erlang:statistics(runtime),</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;erlang:statistics(wall_clock),</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do_send(</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">N</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">Socket</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">),</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">_</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">T1</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">}&nbsp;=&nbsp;erlang:statistics(runtime),</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">_</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">T2</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">}&nbsp;=&nbsp;erlang:statistics(wall_clock),</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;io:format(</span><span style="mso-spacerun:'yes'; color:rgb(188,143,143); font-size:10.0000pt; font-family:'Courier New'; ">&quot;~p&nbsp;~p&quot;</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;[</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">T1</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">T2</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">]);</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{error,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">Reason</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">}&nbsp;-&gt;</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;io:format(</span><span style="mso-spacerun:'yes'; color:rgb(188,143,143); font-size:10.0000pt; font-family:'Courier New'; ">&quot;connect&nbsp;failed:&nbsp;~p&quot;</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;[</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">Reason</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">])</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">end</span><span style="mso-spacerun:'yes'; color:rgb(0,0,255); font-size:10.0000pt; font-family:'Courier New'; ">.</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">do_send(</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">N</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">Socket</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">)&nbsp;-&gt;</span><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lists:foreach(</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">fun</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">(</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">_</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">)&nbsp;-&gt;&nbsp;gen_tcp:send(</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">Socket</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;&lt;&lt;</span><span style="mso-spacerun:'yes'; color:rgb(188,143,143); font-size:10.0000pt; font-family:'Courier New'; ">&quot;Hello&nbsp;world!&quot;</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">&gt;&gt;)&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(160,32,240); font-weight:bold; font-size:10.0000pt; font-family:'Courier New'; ">end</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;lists:seq(</span><span style="mso-spacerun:'yes'; color:rgb(90,90,180); font-size:10.0000pt; font-family:'Courier New'; ">1</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">,&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(184,134,11); font-size:10.0000pt; font-family:'Courier New'; ">N</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">))</span><span style="mso-spacerun:'yes'; color:rgb(0,0,255); font-size:10.0000pt; font-family:'Courier New'; ">.</span><span style="mso-spacerun:'yes'; color:rgb(0,0,255); font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,255); font-size:10.0000pt; font-family:'Courier New'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; font-size:10.0000pt; font-family:'宋体'; ">启动服务端<font face="Courier New">:</font></span><span style="mso-spacerun:'yes'; color:rgb(0,0,255); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">socket_io_test</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">:server().</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">启动发包客户端：</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'Courier New'; ">socket_io_test</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">:client(100000).&nbsp;100000<font face="宋体">表示发包的数量，每个包的大小为</font><font face="Courier New">12</font><font face="宋体">个字节，加上</font><font face="Courier New">TCP</font><font face="宋体">头部，一共</font><font face="Courier New">36</font><font face="宋体">字节。&nbsp;</font></span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">测试包的数量：&nbsp;<font face="Courier New">400000(40W)</font></span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">服务器环境：&nbsp;</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">Intel(R)&nbsp;Xeon(R)&nbsp;CPU&nbsp;&nbsp;&nbsp;E5420&nbsp;&nbsp;@&nbsp;2.50GHz&nbsp;<font face="宋体">双四核</font></span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">12G<font face="宋体">内存</font></span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">100M<font face="宋体">带宽独享</font></span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">测试结果：</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<table style="border-collapse:collapse;<br />
mso-table-layout-alt:fixed;<br />
padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; "><br />
<tbody>
<tr style="height:26.0000pt; ">
<td style="width:276.9500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:0.5000pt solid rgb(0,0,0); border-right:0.5000pt solid rgb(0,0,0); border-top:0.5000pt solid rgb(0,0,0); border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="369">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:79.5000pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:0.5000pt solid rgb(0,0,0); border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="106">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">runtime</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:75.7500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:0.5000pt solid rgb(0,0,0); border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="101">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">wall_clock</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:32.7500pt; ">
<td style="width:276.9500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:0.5000pt solid rgb(0,0,0); border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="369">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">-smp&nbsp;auto</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:79.5000pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="106">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">650&nbsp;</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:75.7500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="101">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">1558</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:32.7500pt; ">
<td style="width:276.9500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:0.5000pt solid rgb(0,0,0); border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="369">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">-smp&nbsp;auto&nbsp;+h&nbsp;99999</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:79.5000pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="106">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">630</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:75.7500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="101">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">1641</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:35.0000pt; ">
<td style="width:276.9500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:0.5000pt solid rgb(0,0,0); border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="369">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">+K&nbsp;true&nbsp;</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:79.5000pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="106">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">670&nbsp;</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:75.7500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="101">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">1626</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:34.7500pt; ">
<td style="width:276.9500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:0.5000pt solid rgb(0,0,0); border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="369">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">-smp&nbsp;disable</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:79.5000pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="106">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">410</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:75.7500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="101">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">770</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:37.0000pt; ">
<td style="width:276.9500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:0.5000pt solid rgb(0,0,0); border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="369">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">+K&nbsp;true&nbsp;-smp&nbsp;disable</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:79.5000pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="106">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">430</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:75.7500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="101">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">797</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:40.0000pt; ">
<td style="width:276.9500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:0.5000pt solid rgb(0,0,0); border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="369">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">+K&nbsp;true&nbsp;-smp&nbsp;disable&nbsp;+h&nbsp;99999</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:79.5000pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="106">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">420</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
<td style="width:75.7500pt; padding:0.0000pt 5.4000pt 0.0000pt 5.4000pt ; border-left:none; ; border-right:0.5000pt solid rgb(0,0,0); border-top:none; ; border-bottom:0.5000pt solid rgb(0,0,0); " valign="top" width="101">
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">1133</span><span style="color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">结果表明&nbsp;<font face="Courier New">smp&nbsp;disable</font><font face="宋体">模式下发包速度明显快于</font><font face="Courier New">smp&nbsp;auto</font><font face="宋体">模式，原因在于多核模式下，</font><font face="Courier New">CPU</font><font face="宋体">切换的代价是相当高的。另外由于是一对一的发包，所以</font><font face="Courier New">+K</font><font face="宋体">参数也没有什么效果。</font></span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">产生的问题：</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">多核并发<font face="Courier New">IO</font><font face="宋体">是否没有优势？得去看看</font><font face="Courier New">Linux</font><font face="宋体">底层的实现了。（原谅我对这块的无知）</font></span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">1.</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">如果多核并发进行网络<font face="Courier New">IO</font><font face="宋体">的能力要弱于单核，那么在用</font><font face="Courier New">erlang</font><font face="宋体">进行服务端设计的时候就应该尽量让网关独占某个</font><font face="Courier New">CPU</font><font face="宋体">并设置为</font><font face="Courier New">-smp&nbsp;disable</font><font face="宋体">模式。</font></span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
<p class="p0" style="margin-bottom:0pt; margin-top:0pt; "><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">2.</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; ">如果有优势，如何利用呢？嗯，这又是一个问题。</span><span style="mso-spacerun:'yes'; color:rgb(0,0,0); font-size:10.0000pt; font-family:'宋体'; "><o:p></o:p></span></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.qingliangcn.com/2010/02/erlang-tcp%e5%8f%91%e5%8c%85%e9%80%9f%e5%ba%a6%e6%b5%8b%e8%af%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>


