<?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/zhengjie19" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feeds.feedsky.com/csdn.net/zhengjie19" type="application/rss+xml"></fs:self_link><lastBuildDate>Mon, 22 Dec 2008 10:30:00 GMT</lastBuildDate><title>郑捷的专栏</title><link>http://blog.csdn.net/zhengjie19/</link><item><title>setsockopt()改善程序的健壮性</title><link>http://blog.csdn.net/zhengjie19/archive/2008/12/22/3580640.aspx</link><wfw:comment>http://blog.csdn.net/zhengjie19/comments/3580640.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhengjie19/comments/commentRss/3580640.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=3580640</trackback:ping><description>&lt;br /&gt;1. 如果在已经处于 ESTABLISHED状态下的socket(一般由端口号和标志符区分）调用&lt;br /&gt;closesocket（一般不会立即关闭而经历TIME_WAIT的过程）后想继续重用该socket：&lt;br /&gt;BOOL bReuseaddr=TRUE;&lt;br /&gt;setsockopt(s,SOL_SOCKET ,SO_REUSEADDR,(const char*)&amp;bReuseaddr,sizeof(BOOL)); 
&lt;br /&gt;2. 如果要已经处于连接状态的soket在调用closesocket后强制关闭，不经历&lt;br /&gt;TIME_WAIT的过程：&lt;br /&gt;BOOL bDontLinger = FALSE; &lt;br /&gt;setsockopt(s,SOL_SOCKET,SO_DONTLINGER,(const char*)&amp;bDontLinger,sizeof(BOOL)); 
&lt;br /&gt;3.在send(),recv()过程中有时由于网络状况等原因，发收不能预期进行,而设置收发时限：&lt;br /&gt;int nNetTimeout=1000;//1秒&lt;img src =&quot;http://blog.csdn.net/zhengjie19/aggbug/3580640.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Mon, 22 Dec 2008 18:30:00 +0800</pubDate><author>zhengjie</author><comments>http://blog.csdn.net/zhengjie19/archive/2008/12/22/3580640.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/zhengjie19/archive/2008/12/22/3580640.aspx</guid><dc:creator>zhengjie</dc:creator></item><item><title>strtok</title><link>http://blog.csdn.net/zhengjie19/archive/2008/11/18/3325105.aspx</link><wfw:comment>http://blog.csdn.net/zhengjie19/comments/3325105.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhengjie19/comments/commentRss/3325105.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=3325105</trackback:ping><description>函数名:   strtok     &lt;br /&gt;  功     能:   查找由在第二个串中指定的分界符分隔开的单词     &lt;br /&gt;  用     法:   char   *strtok(char   *str1,   char   *str2);     &lt;br /&gt;  程序例:     &lt;br /&gt;&lt;br /&gt;  #include   &lt;br /&gt;  #include   &lt;br /&gt;&lt;br /&gt;  int   main(void)     &lt;br /&gt;  {     &lt;br /&gt;        char   input[16]   =   &quot;abc,d&quot;;     &lt;br /&gt;        char   *p;     &lt;br /&gt;&lt;br /&gt;        /*   strtok   places   a   NULL   terminator     &lt;br /&gt;        in   front   of   the   token,   if   found   */     &lt;img src =&quot;http://blog.csdn.net/zhengjie19/aggbug/3325105.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Tue, 18 Nov 2008 20:34:00 +0800</pubDate><author>zhengjie</author><comments>http://blog.csdn.net/zhengjie19/archive/2008/11/18/3325105.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/zhengjie19/archive/2008/11/18/3325105.aspx</guid><dc:creator>zhengjie</dc:creator></item><item><title>重叠模型--事件对象通知</title><link>http://blog.csdn.net/zhengjie19/archive/2008/11/12/3282705.aspx</link><wfw:comment>http://blog.csdn.net/zhengjie19/comments/3282705.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhengjie19/comments/commentRss/3282705.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=3282705</trackback:ping><description>第一章 一． 重叠模型的优点 1. 可以运行在支持Winsock2的所有Windows平台 ,而不像完成端口只是支持NT系统。 2. 比起阻塞、select、WSAAsyncSelect以及WSAEventSelect等模型，重叠I/O(Overlapped I/O)模型使应用程序能达到更佳的系统性能。 因为它和这4种模型不同的是，使用重叠模型的应用程序通知缓冲区收发系统直接使用数据，也就是说，如果应用程序投递了一个10KB大小的缓冲区来接收数据，且数据已经到达套接字，则该数据将直接被拷贝到投递的缓冲区。 而这4种模型种，数据到达并拷贝到单套接字接收缓冲区中，此时应用程序会被告知可以读入的容量。当应用程序调用接收函数之后，数据才从单套接字缓冲区拷贝到应用程序的缓冲区，差别就体现出来了。 3. 从《windows网络编程》中提供的试验结果中可以看到，在使用了P4 1.7G Xero处理器(CPU很强啊)以及768MB的回应服务器中，最大可以处理4万多个SOC&lt;img src =&quot;http://blog.csdn.net/zhengjie19/aggbug/3282705.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Thu, 13 Nov 2008 00:27:00 +0800</pubDate><author>zhengjie</author><comments>http://blog.csdn.net/zhengjie19/archive/2008/11/12/3282705.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/zhengjie19/archive/2008/11/12/3282705.aspx</guid><dc:creator>zhengjie</dc:creator></item><item><title>WSAEventSelect－事件通知模型</title><link>http://blog.csdn.net/zhengjie19/archive/2008/11/12/3280235.aspx</link><wfw:comment>http://blog.csdn.net/zhengjie19/comments/3280235.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhengjie19/comments/commentRss/3280235.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=3280235</trackback:ping><description>SOCKET Socket[WSA_MAXIMUM_WAIT_EVENTS];WSAEVENT Event[WSA_MAXIMUM_WAIT_EVENTS];SOCKET Accept, Listen;DWORD EventTotal = 0;DWORD Index;// Set up a TCP socket for listening on port 5150 Listen = socket(PF_INET, SOCK_STREAM, 0);InternetAddr.sin_family = AF_INET;InternetAddr.sin_addr.s_addr = htonl(INADDR_ANY);InternetAddr.sin_port = htons(5150);bind(Listen, (PSOCKADDR) &amp;InternetAddr, sizeof(InternetAddr));NewEvent = WSACreateEvent();WSAEventSelect(Listen, NewEvent, FD_ACCEPT | FD_CLOSE);listen(List&lt;img src =&quot;http://blog.csdn.net/zhengjie19/aggbug/3280235.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Wed, 12 Nov 2008 19:46:00 +0800</pubDate><author>zhengjie</author><comments>http://blog.csdn.net/zhengjie19/archive/2008/11/12/3280235.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/zhengjie19/archive/2008/11/12/3280235.aspx</guid><dc:creator>zhengjie</dc:creator></item><item><title>WSAAsyncSelect 异步I/O模型</title><link>http://blog.csdn.net/zhengjie19/archive/2008/11/12/3280225.aspx</link><wfw:comment>http://blog.csdn.net/zhengjie19/comments/3280225.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhengjie19/comments/commentRss/3280225.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=3280225</trackback:ping><description>WSAAsyncSelect(s, hwnd, WM_SOCKET, FD_CONNECT | FD_READ | FD_WRITE | FD_CLOSE); 这样一来，我们的应用程序以后便可在套接字 s上，接收到有关连接、发送、接收以及套接字关闭这一系列网络事件的通知。特别要注意的是，多个事件务必在套接字上一次注册！另外还要注意的是，一旦在某个套接字上允许了事件通知，那么以后除非明确调用c l o s e s o c k e t命令，或者由应用程序针对那个套接字调用了 W S A A s y n c S e l e c t，从而更改了注册的网络事件类型，否则的话，事件通知会永远有效！若将 l E v e n t参数设为0，效果相当于停止在套接字上进行的所有网络事件通知。若应用程序针对一个套接字调用了W S A A s y n c S e l e c t，那么套接字的模式会从“锁定”自动变成“非锁定”，我们在前面已提到过这一点。这样一来，假如调用了像W S A R e c v这样的Wi n s o c kI / O函数，但当时却并没有数据可用，那么必&lt;img src =&quot;http://blog.csdn.net/zhengjie19/aggbug/3280225.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Wed, 12 Nov 2008 19:43:00 +0800</pubDate><author>zhengjie</author><comments>http://blog.csdn.net/zhengjie19/archive/2008/11/12/3280225.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/zhengjie19/archive/2008/11/12/3280225.aspx</guid><dc:creator>zhengjie</dc:creator></item><item><title>很幽默的讲解六种Socket IO模型</title><link>http://blog.csdn.net/zhengjie19/archive/2008/11/12/3280086.aspx</link><wfw:comment>http://blog.csdn.net/zhengjie19/comments/3280086.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhengjie19/comments/commentRss/3280086.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=3280086</trackback:ping><description> 很幽默的讲解六种Socket IO模型(转)&lt;br /&gt;本文简单介绍了当前Windows支持的各种Socket I/O模型，如果你发现其中存在什么错误请务必赐教。 &lt;br /&gt;一：select模型 &lt;br /&gt;二：WSAAsyncSelect模型 &lt;br /&gt;三：WSAEventSelect模型 &lt;br /&gt;四：Overlapped I/O 事件通知模型 &lt;br /&gt;五：Overlapped I/O 完成例程模型 &lt;br /&gt;六：IOCP模型 &lt;br /&gt;老陈有一个在外地工作的女儿，不能经常回来，老陈和她通过信件联系。他们的信会被邮递员投递到他们的信箱里。 &lt;br /&gt;这和Socket模型非常类似。下面我就以老陈接收信件为例讲解Socket I/O模型~~~ &lt;br /&gt;一：select模型 &lt;br /&gt;老陈非常想看到女儿的信。以至于他每隔10分钟就下楼检查信箱，看是否有女儿的信~~~~~ &lt;br /&gt;在这种情况下，&quot;下楼检查信箱&quot;然后回到楼上耽误了老陈太多的时间，以至于老陈无法做其他工作。 &lt;br /&gt;select模型和老陈的这种情况非常相似：周而复始地去检查......如果有数据&lt;img src =&quot;http://blog.csdn.net/zhengjie19/aggbug/3280086.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Wed, 12 Nov 2008 19:17:00 +0800</pubDate><author>zhengjie</author><comments>http://blog.csdn.net/zhengjie19/archive/2008/11/12/3280086.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/zhengjie19/archive/2008/11/12/3280086.aspx</guid><dc:creator>zhengjie</dc:creator></item><item><title>多线程同步</title><link>http://blog.csdn.net/zhengjie19/archive/2008/10/30/3185447.aspx</link><wfw:comment>http://blog.csdn.net/zhengjie19/comments/3185447.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhengjie19/comments/commentRss/3185447.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=3185447</trackback:ping><description>&lt;br /&gt;线程的同步可分用户模式的线程同步和内核对象的线程同步两大类&lt;br /&gt;临界区是属于用户模式的线程同步; 只能用于一个进程里面的多线程同步&lt;br /&gt;内核的同步有:&lt;br /&gt;管理事件内核对象:跨进程:使用临界区只能同步同一进程中的线程，而使用事件内核对象则可以对进程外的线程进行同步，其前提是得到对此事件对象的访问权。可以通过OpenEvent（）函数获取得到，其函数原型为：&lt;br /&gt;&lt;br /&gt;信号量内核对象:不能跨进程:　信号量的使用特点使其更适用于对Socket（套接字）程序中线程的同步。例如，网络上的HTTP服务器要对同一时间内访问同一页面的用户数加以限制，这时可以为没一个用户对服务器的页面请求设置一个线程，而页面则是待保护的共享资源，通过使用信号量对线程的同步作用可以确保在任一时刻无论有多少用户对某一页面进行访问，只有不大于设定的最大用户数目的线程能够进行访问，而其他的访问企图则被挂起，只有在有用户退出对此页面的访问后才有可能进入&lt;br /&gt;互斥内核对象:跨进程 互斥（Mutex）是一种用途非常广泛的内核对象。能够保证多个线程对同一共享资源的互斥访问。同临界区有些&lt;img src =&quot;http://blog.csdn.net/zhengjie19/aggbug/3185447.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Thu, 30 Oct 2008 23:30:00 +0800</pubDate><author>zhengjie</author><comments>http://blog.csdn.net/zhengjie19/archive/2008/10/30/3185447.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/zhengjie19/archive/2008/10/30/3185447.aspx</guid><dc:creator>zhengjie</dc:creator></item><item><title>C++中Static作用和使用方法</title><link>http://blog.csdn.net/zhengjie19/archive/2008/10/30/3183094.aspx</link><wfw:comment>http://blog.csdn.net/zhengjie19/comments/3183094.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhengjie19/comments/commentRss/3183094.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=3183094</trackback:ping><description>Static&lt;img src =&quot;http://blog.csdn.net/zhengjie19/aggbug/3183094.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Thu, 30 Oct 2008 19:24:00 +0800</pubDate><author>zhengjie</author><comments>http://blog.csdn.net/zhengjie19/archive/2008/10/30/3183094.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/zhengjie19/archive/2008/10/30/3183094.aspx</guid><dc:creator>zhengjie</dc:creator></item><item><title>一道普通的面试一题目指针做参数</title><link>http://blog.csdn.net/zhengjie19/archive/2008/09/19/2950868.aspx</link><wfw:comment>http://blog.csdn.net/zhengjie19/comments/2950868.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhengjie19/comments/commentRss/2950868.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2950868</trackback:ping><description>&lt;br /&gt;&lt;img src =&quot;http://blog.csdn.net/zhengjie19/aggbug/2950868.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Fri, 19 Sep 2008 19:24:00 +0800</pubDate><author>zhengjie</author><comments>http://blog.csdn.net/zhengjie19/archive/2008/09/19/2950868.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/zhengjie19/archive/2008/09/19/2950868.aspx</guid><dc:creator>zhengjie</dc:creator></item><item><title>epoll 学习</title><link>http://blog.csdn.net/zhengjie19/archive/2008/04/08/2260975.aspx</link><wfw:comment>http://blog.csdn.net/zhengjie19/comments/2260975.aspx</wfw:comment><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/zhengjie19/comments/commentRss/2260975.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2260975</trackback:ping><description>epoll 学习&lt;img src =&quot;http://blog.csdn.net/zhengjie19/aggbug/2260975.aspx&quot; width = &quot;1&quot; height = &quot;1&quot; /&gt;</description><pubDate>Wed, 09 Apr 2008 00:39:00 +0800</pubDate><author>zhengjie</author><comments>http://blog.csdn.net/zhengjie19/archive/2008/04/08/2260975.aspx#Feedback</comments><guid isPermaLink="false">http://blog.csdn.net/zhengjie19/archive/2008/04/08/2260975.aspx</guid><dc:creator>zhengjie</dc:creator></item></channel></rss>