<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:media="http://search.yahoo.com/mrss/"
	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>socket - 四号程序员</title>
	<atom:link href="https://www.coder4.com/archives/tag/socket/feed" rel="self" type="application/rss+xml" />
	<link>https://www.coder4.com</link>
	<description>Keep It Simple and Stupid</description>
	<lastBuildDate>Tue, 18 Oct 2011 02:46:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>Linux下高并发Socket连接的优化</title>
		<link>https://www.coder4.com/archives/1603</link>
					<comments>https://www.coder4.com/archives/1603#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Sun, 29 May 2011 13:48:51 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[优化]]></category>
		<category><![CDATA[网络]]></category>
		<category><![CDATA[高并发]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=1603</guid>

					<description><![CDATA[1、打开文件优化 #对当前shell ulimit -n 102400 echo "ulimit -n 102400" &#62;&#62; ~/.bashrc #针对所有用户 sudo vim /etc/security/limits.conf * soft nofile 102400 * hard nofile 102400 #针对系统 cat /proc/sys/fs/file-max echo 1024000 &#62; /proc/sys/fs/file-max[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/1603/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[转]socket 编程中出现的两个情况及原因分析</title>
		<link>https://www.coder4.com/archives/313</link>
					<comments>https://www.coder4.com/archives/313#comments</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Tue, 26 Jan 2010 17:27:32 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Connection reset by peer]]></category>
		<category><![CDATA[socket]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=313</guid>

					<description><![CDATA[感谢原文地址：http://blog.csdn.net/rstevens/archive/2008/11/12/3284661.aspx 1. Connection reset by peer 如果调用 read() 从 TCP 连接上接收数据并返回 -1，且 errno 为 104（Connection reset by peer）；这通常表示对端程序没有关闭 socket 就直接退出了 （例如 core dump ）； 正常调用 close() 来关闭一个 socket， 会导致关闭连接的[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/313/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Linux下socket非阻塞的一些技巧</title>
		<link>https://www.coder4.com/archives/300</link>
					<comments>https://www.coder4.com/archives/300#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Wed, 06 Jan 2010 15:21:28 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[blocking]]></category>
		<category><![CDATA[nonblocking]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[tips]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=300</guid>

					<description><![CDATA[在Linux下，connect()建立连接，-1为失败，但是-1不一定就是完全失败！ -1的情况下，有的是因为非阻塞造成的，就是在error中设置了对应的出错情况，例如EINPROGRESS,EAGAIN等可以认为是&#8220;非致命错误&#8221;，认为是可以接受的，这种只是导致暂时阻塞等情况。 所以可以如下使用 int ret = connect(...); if(!ret &#124;&#124; noFatalError()) { &#160;&#160;//认为是成功的 } bool nonFa[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/300/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Linux设置socket客户端的连接超时</title>
		<link>https://www.coder4.com/archives/285</link>
					<comments>https://www.coder4.com/archives/285#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Mon, 28 Dec 2009 03:29:34 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[连接超时]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=285</guid>

					<description><![CDATA[非常感谢原作者：http://hi.baidu.com/ganss/blog/item/1c69d3139036a8836538dba0.html &#160; 原来我们实现connect()超时基本上都使用unix网络编程一书的非阻塞方式（connect_nonb），今天在网上看到一篇文章，觉得很有意思，转载如下： 读Linux内核源码的时候偶然发现其connect的超时参数竟然和用SO_SNDTIMO操作的参数一致: 　　File: net/ipv4/af_inet.c [cpp] t[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/285/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>今天之囧（二）：Linux向外TCP最大连接只能打开28232个端口</title>
		<link>https://www.coder4.com/archives/159</link>
					<comments>https://www.coder4.com/archives/159#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Fri, 04 Dec 2009 16:20:39 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[28232]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[TCP最大连接端口]]></category>
		<category><![CDATA[限制]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=159</guid>

					<description><![CDATA[晚上想写一个关于Echo服务器的压力测试，这一写，就出现不少问题，先是epoll的LT和EG问题，这个一会儿再说，然后改好了又遇到一个诡异的问题：在一个程序中反复用socket连接的话，到了28231左右就会莫名奇妙的断掉，提示：Cannot assign requested address，我在google，baidu搜索了这个数值半天，都没有什么结果。 终于找到了一篇文章，转载下来，感谢原作者： http://hi.baidu.com/jabber/blog/item/da445182769[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/159/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>用epoll实现异步的Echo服务器</title>
		<link>https://www.coder4.com/archives/135</link>
					<comments>https://www.coder4.com/archives/135#comments</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Tue, 01 Dec 2009 16:39:45 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[epoll]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[异步]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=135</guid>

					<description><![CDATA[epoll是Kernel 2.6后新加入的事件机制，在高并发条件下，远优于select. 用个硬件中的例子吧，可能不太恰当：epoll相当于I／O中断（有的时候才相应），而select相当于轮询（总要反复查询）。 其实epoll比slect好用很多，主要一下几个用法。 struct epoll_event ; epoll事件体，事件发生时候你可以得到一个它。其中epoll_event.data.fd可以存储关联的句柄，epoll_event.event是监听标志，常用的有EPOLLIN （有数据[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/135/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Linux下用select()实现异步的Echo服务器</title>
		<link>https://www.coder4.com/archives/130</link>
					<comments>https://www.coder4.com/archives/130#comments</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Mon, 30 Nov 2009 15:58:55 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[异步]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=130</guid>

					<description><![CDATA[本例子使用异步socket（select方法）实现了ECHO服务器程序。 搞了一个晚上，终于弄好了，出现的问题主要如下： 这是最重要的问题！当读取完数据后，需要将数据重新FD_SET进去，特别是serverFd，注意这个testFd意义非常重大，相当于参数传递中的复制行参，需要好好体会。 当read(rd)后，返回为0表示客户端的socket已经关闭，此时除了要FD_CLR，还要关闭fd!!否则fd资源没有被释放，很快就会达到select监听的上限！ [cpp] /* * main.c[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/130/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
