2010-03-02 13:41 | Posted by Sunshow | Filed Under C, Network
调用libcurl下载,然后使用netstat查看发现有大量的TCP连接保持在CLOSE_WAIT状态
查看libcurl的文档说明,有这样一个选项:
CURLOPT_FORBID_REUSE
Pass a long. Set to 1 to make the next transfer explicitly close the connection when done. Normally, libcurl keeps all connections alive when done with one transfer in case a succeeding one follows that can re-use them. This option should be used with caution and only if you understand what it does. Set to 0 to have libcurl keep the connection open for possible later re-use (default behavior).
也就是说,默认情况下libcurl完成一个任务以后,出于重用连接的考虑不会马上关闭
如果没有新的TCP请求来重用这个连接,那么只能等到CLOSE_WAIT超时,这个时间默认在7200秒甚至更高,太多的CLOSE_WAIT连接会导致性能问题
解决方法:
curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1);
最好再修改一下TCP参数调低CLOSE_WAIT和TIME_WAIT的超时时间
标签:
libcurl,
TCP,
下载
相关日志
2009-12-14 23:24 | Posted by Sunshow | Filed Under Software, WebDev
推荐一个CSS Sprites样式生成工具
作者主页:http://www.cssforest.org/blog/index.php?id=129
这是一个基于Adobe AIR的工具,需要下载AIR运行时
使用效果图:

操作说明:
载入图片后,双击新增一个区域,设置每个区域的类名等属性,最后可以导出css列表
更多说明可以参考主页内容
标签:
adobe,
AIR,
css,
sprite,
下载,
列表,
图片,
样式
相关日志
2009-03-20 07:55 | Posted by Sunshow | Filed Under Software
2008-06-18 02:56 | Posted by Sunshow | Filed Under Software
Firefox 3 已经正式发布并可以下载了
中文版 Firefox 3
英文版 Firefox 3
本人强烈推荐所有Firefox用户更新至3.0版本
顺便贴一下我用的扩展,有图有真相

标签:
firefox,
下载,
扩展
相关日志
2007-02-15 08:39 | Posted by Sunshow | Filed Under Software
把新版本的快车删了,下载的问题太大,经常退回去重复下载。
还是经典的网际快车靠得住,名字也看着顺眼。
以后下BT就用μTorrent了,挺好的,推荐。
powered by performancing firefox
标签:
BT,
下载
相关日志
Recent Comments