<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	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>Intrepid Blog &#187; select</title>
	<atom:link href="http://blog.affien.com/archives/tag/select/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.affien.com</link>
	<description>A few thoughts</description>
	<lastBuildDate>Mon, 23 Jan 2012 08:47:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Interrupting a select without a timeout</title>
		<link>http://blog.affien.com/archives/2008/03/11/interrupting-a-select-without-a-timeout/</link>
		<comments>http://blog.affien.com/archives/2008/03/11/interrupting-a-select-without-a-timeout/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 22:24:30 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[socketpair]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2008/03/11/interrupting-a-select-without-a-timeout/</guid>
		<description><![CDATA[select is a POSIX syscall which allows you to wait on s [...]]]></description>
			<content:encoded><![CDATA[<p><code>select</code> is a POSIX syscall which allows you to wait on several different filedescriptors (including sockets) for the event that they won&#8217;t block on write; won&#8217;t block or read or are in error.  This syscall is very convenient when you&#8217;re writing a server.</p>
<p>When I want to shutdown an instance of the server, I have to interrupt the <code>select</code>.  I have yet to find a satisfying way of doing this.  At the moment I create a pair of linked sockets with <code>socketpair</code>.  I include one of them to the sockets on which to block until there is data to read in the <code>select</code> call.  To interrupt, I simply write some data to the other socket which will cause data to be available on the socket which in turn will interrupt the <code>select</code>.</p>
<p>There must be a more elegant solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2008/03/11/interrupting-a-select-without-a-timeout/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

