﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-野猪世界 专注游戏技术-随笔分类-网络</title><link>http://www.cppblog.com/zhuyeaini/category/18394.html</link><description>ogre cegui qt bullet python</description><language>zh-cn</language><lastBuildDate>Thu, 22 Dec 2011 14:36:28 GMT</lastBuildDate><pubDate>Thu, 22 Dec 2011 14:36:28 GMT</pubDate><ttl>60</ttl><item><title>tcp nagle算法</title><link>http://www.cppblog.com/zhuyeaini/archive/2011/12/22/162616.html</link><dc:creator>野猪红</dc:creator><author>野猪红</author><pubDate>Thu, 22 Dec 2011 13:46:00 GMT</pubDate><guid>http://www.cppblog.com/zhuyeaini/archive/2011/12/22/162616.html</guid><wfw:comment>http://www.cppblog.com/zhuyeaini/comments/162616.html</wfw:comment><comments>http://www.cppblog.com/zhuyeaini/archive/2011/12/22/162616.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zhuyeaini/comments/commentRss/162616.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zhuyeaini/services/trackbacks/162616.html</trackback:ping><description><![CDATA[好 这tcp什么的确实比较复杂<br />知道多少写多少<br />nagle算法是什么：它的目标是防止大量小数据包的出现而影响网络效率<br />实际实现上有两种：1网络上的空闲段限制 2发送数据包的限制<br />如何做的：如果网络上有超过上面两种的限制 那么将会累积后面的数据包直至网络空闲时发送<br />看几个例子<br />平常 nagle算法平时并不怎么影响tcp <br />比如：A发送N个数据到B B接受N个数据 并发送ack给A A继续下一次发送 假如A处理比较慢 这时B会累积后面的数据包直至收到ack后一次性发送<br />但是：假如A想要发送N+K个数据到B 首先发送N个数据 B接受N+K个数据 这时 A因为nagle算法不会继续发送直到收到ACK<br />但B因为还在等待后K个数据而不会发送ACK 这时通信效率比较低下<br />因此 具体实现看应用程序吧<br />思想就是如此 介绍一个比较好的游戏网络库：<br />里面有nagle算法的应用 还有设置缓冲区为0的操作<br /><div><a href="http://code.google.com/p/yynetsdk/">http://code.google.com/p/yynetsdk/</a></div><img src ="http://www.cppblog.com/zhuyeaini/aggbug/162616.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zhuyeaini/" target="_blank">野猪红</a> 2011-12-22 21:46 <a href="http://www.cppblog.com/zhuyeaini/archive/2011/12/22/162616.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>