<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feeds.feedsky.com/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feeds.feedsky.com/csdn.net/liutaoxwl" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feeds.feedsky.com/csdn.net/liutaoxwl" type="application/rss+xml"></fs:self_link><lastBuildDate>Fri, 13 Mar 2009 15:36:00 GMT</lastBuildDate><title>liutaoxwl的专栏</title><description>我的好文章摘选</description><link>http://blog.csdn.net/liutaoxwl/</link><item><title>服务器端开发经验总结 (Linux C语言) – 1</title><link>http://blog.csdn.net/liutaoxwl/archive/2009/03/13/3987801.aspx</link><wfw:comment>http://blog.csdn.net/liutaoxwl/comments/3987801.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/liutaoxwl/comments/commentRss/3987801.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=3987801</trackback:ping><description>简介  在进行服务器端开发的时候需要考虑一些算法和性能问题，经过了几年的开发，对这方面有了一些经验，现在写下来跟大家分享和讨论。  我主要是在Linux下进行C语言的开发，所以后面的实现都是基于Linux操作系统并用C语言来讲解。其它平台和语言需要考虑的问题是类似的只不过可能是实现细节上有一些差异，我尽量减少这些差异吧。注意一下讲解的所有内容都是基于32位系统的开发！  服务器程序开发核心是稳定，在稳定的前提下需要考虑效率。其中主要的公共模块是内存池和线程池。因为服务器程序一般都会长时间的运行，而且频繁的进行创建和释放内存的操作，这时如果使用系统的malloc和free方法，则会使系统中产生很多内存碎片，从而影响效率和稳定性。内存池的主要思想是先调用系统的malloc开辟一个很大的内存，然后对这个大内存进行管理，程序中要使用内存时，内存池分配内存，程序要释放内存时，只是通知内存池，而不真正释放内存。线程池，原理类似，并发处理一些任务的时候，需要使用很多线程，我们可以先创建很多线程，然后每次有任务需要处理，则找到一个空闲的线程让它来处理任务，处理完成后线程挂起。这样省去了每次一个任务都创&lt;img src =&quot;http://blog.csdn.net/liutaoxwl/aggbug/3987801.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Fri, 13 Mar 2009 23:36:00 +0800</pubDate><author>liutaoxwl</author><comments>http://blog.csdn.net/liutaoxwl/archive/2009/03/13/3987801.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/liutaoxwl/archive/2009/03/13/3987801.aspx</guid><dc:creator>liutaoxwl</dc:creator></item><item><title>Windows下使用标准Shell接口遍历文件和文件夹(2)</title><link>http://blog.csdn.net/liutaoxwl/archive/2009/02/25/3935861.aspx</link><wfw:comment>http://blog.csdn.net/liutaoxwl/comments/3935861.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/liutaoxwl/comments/commentRss/3935861.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=3935861</trackback:ping><description>TreeView实现目录树-tree_view的相关方法  使用TreeView实现目录树，其中每个节点都是一个文件夹对象（也可能是虚拟文件夹）。而ListView显示所有的文件对象和子文件夹对象。如下图：     如果某个文件夹对象拥有子文件夹，这个文件夹所对应的节点前面会有一个表示可以展开的符号“+”。点击“+”可以展开当前节点，显示这个文件夹对象中的所有子文件夹对象。  实现的时候，我们的TreeView包含一个普通的子窗体和一个TreeView窗体，将这两个窗体作为TreeView使用。TreeView窗体是普通子窗体的子窗体。在使用的时候，如果在主窗体使用我们提供的方法创建TreeView，实际上是在主窗体上创建了一个子窗体，在子窗体中创建一个TreeView。下面要实现的是一个普通的TreeView所必备的一些功能的封装。我称为tree_view。要实现真正的显示本地的命名空间树，或者显示远程主机的命名空间树的时候，可以扩展使用tree_view来实现。  tree_view的实现  下面先定义了一些要使用的回调函数：             1: typedef HRES&lt;img src =&quot;http://blog.csdn.net/liutaoxwl/aggbug/3935861.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Wed, 25 Feb 2009 22:20:00 +0800</pubDate><author>liutaoxwl</author><comments>http://blog.csdn.net/liutaoxwl/archive/2009/02/25/3935861.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/liutaoxwl/archive/2009/02/25/3935861.aspx</guid><dc:creator>liutaoxwl</dc:creator></item><item><title>Windows下使用标准Shell接口遍历文件和文件夹(1)</title><link>http://blog.csdn.net/liutaoxwl/archive/2009/02/24/3932219.aspx</link><wfw:comment>http://blog.csdn.net/liutaoxwl/comments/3932219.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/liutaoxwl/comments/commentRss/3932219.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=3932219</trackback:ping><description>在Windows中我们经常需要遍历一个文件夹或者遍历一个磁盘。本文介绍如何使用标准的Shell接口进行遍历。在介绍过程中会逐步的实现一个类似FileZilla的TreeView+ListView的界面。我最近为psftp做界面的时候简单了解了一下这方面的问题。  基础知识  Windows中的目录可以理解为是一个树型结构，树的根是“桌面”，“桌面”中一般拥有“我的电脑”、“网上邻居”、“回收站”等文件夹。这个我们称它为命名空间。物理上呢，“桌面”一般位于“C:\Documents and Settings\用户名称\桌面”。  IShellFolder接口用于管理文件夹，所有Shell命名空间中的文件夹对象都暴露这个接口。我们可以通过SHGetDesktopFolder方法获得“桌面”的IShellFolder接口。当然，最后不使用的时候要调用IShellFolder的Release方法释放接口。  通过调用“桌面”的IShellFolder接口的EnumObjects方法获得IENUMIDLIST接口的指针。IENUMIDLIST接口用于遍历IShellFolder接口表示的文件夹下&lt;img src =&quot;http://blog.csdn.net/liutaoxwl/aggbug/3932219.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Tue, 24 Feb 2009 22:42:00 +0800</pubDate><author>liutaoxwl</author><comments>http://blog.csdn.net/liutaoxwl/archive/2009/02/24/3932219.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/liutaoxwl/archive/2009/02/24/3932219.aspx</guid><dc:creator>liutaoxwl</dc:creator></item><item><title>libevent在异步socket中的使用</title><link>http://blog.csdn.net/liutaoxwl/archive/2008/09/22/2962143.aspx</link><wfw:comment>http://blog.csdn.net/liutaoxwl/comments/2962143.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/liutaoxwl/comments/commentRss/2962143.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2962143</trackback:ping><description>学习libevent的使用的时候，在http://unx.ca/log/libevent_echosrv1c/上看到有三个例子，第一个例子最简单，只是介绍一下大概的使用方法；第二个例子是自己处理异步socket出现可读可写；第三个例子是使用libevent内部提供的bufferd来处理可读可写的事件。 第一个例子： libevent_echosrv1.c/*
 * libevent echo server example.
 */

#include 
#include 
#include 

/* For inet_ntoa. */
#include 

/* Required by event.h. */
#include 

#include 
#include 
#include &lt;img src =&quot;http://blog.csdn.net/liutaoxwl/aggbug/2962143.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Mon, 22 Sep 2008 23:37:00 +0800</pubDate><author>liutaoxwl</author><comments>http://blog.csdn.net/liutaoxwl/archive/2008/09/22/2962143.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/liutaoxwl/archive/2008/09/22/2962143.aspx</guid><dc:creator>liutaoxwl</dc:creator></item><item><title>Linux内核中的红黑树的使用</title><link>http://blog.csdn.net/liutaoxwl/archive/2008/09/19/2952823.aspx</link><wfw:comment>http://blog.csdn.net/liutaoxwl/comments/2952823.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/liutaoxwl/comments/commentRss/2952823.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2952823</trackback:ping><description>最近需要使用红黑树，在网上查找资料的时候无意中发现linux内核中有个红黑树的实现，并且其代码非常的独立，现把它摘录出来。我摘录自2.6.24的内核，分为两个文件rbtree.h和rbtree.c，rbtree.h位于内核源码的include/linux目录中，rbtree.c位于内核源码的lib目录中。      rbtree.h中删除#include 和#include 两行，添加#include     对于rb_node的声明删除掉最后的__attribute__((aligned(sizeof(long))))    最后在rbtree.h中添加如下一些宏定义：    #ifdef __compiler_offsetof     #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)      #else      #define offsetof(TYPE, MEMBER) ((si&lt;img src =&quot;http://blog.csdn.net/liutaoxwl/aggbug/2952823.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Fri, 19 Sep 2008 15:57:00 +0800</pubDate><author>liutaoxwl</author><comments>http://blog.csdn.net/liutaoxwl/archive/2008/09/19/2952823.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/liutaoxwl/archive/2008/09/19/2952823.aspx</guid><dc:creator>liutaoxwl</dc:creator></item><item><title>小结一下Linux下使用TCP通讯时遇到的问题</title><link>http://blog.csdn.net/liutaoxwl/archive/2008/05/15/2449020.aspx</link><wfw:comment>http://blog.csdn.net/liutaoxwl/comments/2449020.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/liutaoxwl/comments/commentRss/2449020.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2449020</trackback:ping><description>在这里总结一下这linux用TCP通讯需要注意的几个问题，都是前一阵子工作中遇到的问题。&lt;br /&gt;问题1. 发送和接收数据时的不完整问题&lt;br /&gt;以接收为例，当对端发送1000个字节的数据时，本端进行接收，会出现调用recv返回500并且errno==EAGAIN的情况（测试中发现这种情况非常严重），这个错误表示当前设备忙，稍后再试。理想化的解决办法是这样的：&lt;br /&gt;    使用select或者epoll机制，当有数据到来时，select或epoll会通知，此时一直接收直到recv返回0表示所有数据都接收完。过程中当errno==EAGAIN则暂停接收，并将已经接收的数据缓存起来。当设备再次可读时select或者epoll会再次通知，在缓存数据的后面继续接收，如此反复n次直到recv返回值为0。&lt;br /&gt;    但是这种方法需要把已经接收的部分数据进行缓存，实现起来非常繁琐，我进行了如下的简单实现，是我封装的epoll中的部分代码：&lt;br /&gt;int&lt;img src =&quot;http://blog.csdn.net/liutaoxwl/aggbug/2449020.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Fri, 16 May 2008 01:18:00 +0800</pubDate><author>liutaoxwl</author><comments>http://blog.csdn.net/liutaoxwl/archive/2008/05/15/2449020.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/liutaoxwl/archive/2008/05/15/2449020.aspx</guid><dc:creator>liutaoxwl</dc:creator></item><item><title>SIP协议解析与实现(c和c++ 使用osip) 11</title><link>http://blog.csdn.net/liutaoxwl/archive/2008/02/04/2083137.aspx</link><wfw:comment>http://blog.csdn.net/liutaoxwl/comments/2083137.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/liutaoxwl/comments/commentRss/2083137.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2083137</trackback:ping><description>本文将按照RFC3261逐步的介绍SIP协议,介绍了c和c++语言的实现，分析了osip库的使用和实现。 ——点击此处阅读全文 &lt;img src =&quot;http://blog.csdn.net/liutaoxwl/aggbug/2083137.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Mon, 04 Feb 2008 21:15:00 +0800</pubDate><author>liutaoxwl</author><comments>http://blog.csdn.net/liutaoxwl/archive/2008/02/04/2083137.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/liutaoxwl/archive/2008/02/04/2083137.aspx</guid><dc:creator>liutaoxwl</dc:creator></item><item><title>SIP协议解析与实现(c和c++ 使用osip) 10</title><link>http://blog.csdn.net/liutaoxwl/archive/2008/02/02/2078827.aspx</link><wfw:comment>http://blog.csdn.net/liutaoxwl/comments/2078827.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/liutaoxwl/comments/commentRss/2078827.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2078827</trackback:ping><description>本文将按照RFC3261逐步的介绍SIP协议,介绍了c和c++语言的实现，分析了osip库的使用和实现。    ——点击此处阅读全文&lt;img src =&quot;http://blog.csdn.net/liutaoxwl/aggbug/2078827.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Sun, 03 Feb 2008 02:14:00 +0800</pubDate><author>liutaoxwl</author><comments>http://blog.csdn.net/liutaoxwl/archive/2008/02/02/2078827.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/liutaoxwl/archive/2008/02/02/2078827.aspx</guid><dc:creator>liutaoxwl</dc:creator></item><item><title>SIP协议解析与实现(c和c++ 使用osip) 9</title><link>http://blog.csdn.net/liutaoxwl/archive/2008/01/23/2061137.aspx</link><wfw:comment>http://blog.csdn.net/liutaoxwl/comments/2061137.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/liutaoxwl/comments/commentRss/2061137.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2061137</trackback:ping><description>本文将按照RFC3261逐步的介绍SIP协议,介绍了c和c++语言的实现，分析了osip库的使用和实现。&lt;img src =&quot;http://blog.csdn.net/liutaoxwl/aggbug/2061137.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Wed, 23 Jan 2008 21:50:00 +0800</pubDate><author>liutaoxwl</author><comments>http://blog.csdn.net/liutaoxwl/archive/2008/01/23/2061137.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/liutaoxwl/archive/2008/01/23/2061137.aspx</guid><dc:creator>liutaoxwl</dc:creator></item><item><title>SIP协议解析与实现(c和c++ 使用osip) 8</title><link>http://blog.csdn.net/liutaoxwl/archive/2007/12/29/2002840.aspx</link><wfw:comment>http://blog.csdn.net/liutaoxwl/comments/2002840.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/liutaoxwl/comments/commentRss/2002840.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2002840</trackback:ping><description>本文将按照RFC3261逐步的介绍SIP协议,介绍了c和c++语言的实现，分析了osip库的使用和实现。 &lt;img src =&quot;http://blog.csdn.net/liutaoxwl/aggbug/2002840.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Sat, 29 Dec 2007 21:23:00 +0800</pubDate><author>liutaoxwl</author><comments>http://blog.csdn.net/liutaoxwl/archive/2007/12/29/2002840.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/liutaoxwl/archive/2007/12/29/2002840.aspx</guid><dc:creator>liutaoxwl</dc:creator></item></channel></rss>