<?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>David Underhill &#187; tcp</title>
	<atom:link href="http://dound.com/tag/tcp/feed/" rel="self" type="application/rss+xml" />
	<link>http://dound.com</link>
	<description>dound&#039;s space on the web</description>
	<lastBuildDate>Tue, 31 Jan 2012 10:57:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Python + Twisted Length-Type-Based Protocol Client / Server</title>
		<link>http://dound.com/2009/03/python-and-twisted-length-type-based-protocol-client-server/</link>
		<comments>http://dound.com/2009/03/python-and-twisted-length-type-based-protocol-client-server/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 09:25:12 +0000</pubDate>
		<dc:creator>David Underhill</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[tcp]]></category>
		<category><![CDATA[twisted]]></category>

		<guid isPermaLink="false">http://dound.com/?p=108</guid>
		<description><![CDATA[I often have a need to work with a simple TCP protocol whose messages have a header which starts with the length of the message and an integer representing the message type.  To save myself the trouble of creating and debugging a very similar custom implementation each time I have this need, I decided to package it as a simple <a href="http://www.python.org">Python</a> framework which does this for me.  It is based on the event-driven <a href="http://www.twistedmatrix.com">Twised</a> networking engine.]]></description>
			<content:encoded><![CDATA[<p>It seems like I often have a need to work with a simple TCP protocol whose messages have a header which starts with the length of the message and an integer representing the message type (<a href="http://openflowswitch.org/">OpenFlow</a> is one of many such protocols).  To save myself the trouble of creating and debugging a very similar custom implementation each time I have this need, I decided to package it as a simple <a href="http://www.python.org">Python</a> framework which does this for me.  It is based on the event-driven <a href="http://www.twistedmatrix.com">Twised</a> networking engine.  Using this simple extension on top of Twisted has a number of benefits:</p>
<ol>
<li>Automatic handling of the length and type fields when sending and receiving messages.</li>
<li>Automatic unpacking of messages based on type.</li>
<li>Client automatically tries to reconnect if the connection is lost.</li>
<li>Server can handle any number of clients simultaneously.</li>
</ol>
<p>You can view the official package on the <a href="http://pypi.python.org">PyPi</a> website <a href="http://pypi.python.org/pypi/ltprotocol">here</a>.  My local page for the package is <a href="http://dound.com/projects/python/ltprotocol/">here</a> &#8212; please <a href="http://dound.com/projects/python/ltprotocol/">view it</a> for an example on how to use this package.</p>
]]></content:encoded>
			<wfw:commentRss>http://dound.com/2009/03/python-and-twisted-length-type-based-protocol-client-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

