<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1.3" -->
<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/"
	>

<channel>
	<title>Talk Nerdy To Me - Java, C#, .Net</title>
	<link>http://www.gavaghan.org/blog</link>
	<description>Mike Gavaghan blogs on Java, C#, .Net, and the software industry</description>
	<pubDate>Mon, 22 Feb 2010 22:25:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.3</generator>
	<language>en</language>
			<item>
		<title>TCP/IP Parameter Tuning for Rapid Client Connections</title>
		<link>http://www.gavaghan.org/blog/2010/02/17/tcpip-parameter-tuning-for-rapid-client-connections/</link>
		<comments>http://www.gavaghan.org/blog/2010/02/17/tcpip-parameter-tuning-for-rapid-client-connections/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 19:37:36 +0000</pubDate>
		<dc:creator>Mike Gavaghan</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<category><![CDATA[CodeProject]]></category>

		<guid isPermaLink="false">http://www.gavaghan.org/blog/2010/02/17/tcpip-parameter-tuning-for-rapid-client-connections/</guid>
		<description><![CDATA[Applications that open and close a large number of client TCP/IP sockets run the risk of running out of available socket ports.  This can happen in a load and performance testing scenario using a tool like LISA Test from iTKO, or it could happen in a production environment if an active application simply needs to rapidly open and close a large number of outbound connections.

On the .NET platform, the exception raised reads "System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted <host>:<port>".

In Java, the exception is "java.net.BindException: Address already in use: connect".  

Both exceptions are misleading because they are generally associated with server socket conflicts – not outbound client socket connections.  However, a better understanding of the TCP state machine sheds some light on this behavior - and a solution.]]></description>
			<content:encoded><![CDATA[<p>Applications that open and close a large number of client TCP/IP sockets run the risk of running out of available socket ports.  This can happen in a load and performance testing scenario using a tool like <a target="_blank" href="http://www.itko.com/products/lisatest.jsp" title="LISA Test - QA Software for Composite Enterprise Applications and SOA">LISA Test</a> from <a target="_blank" href="http://www.itko.com/" title="LISA Virtualization and Validation Software for Modern Applications: SOA, Cloud, and BPM">iTKO</a>, or it could happen in a production environment if an active application simply needs to rapidly open and close a large number of outbound connections.</p>
<p>On the <strong>.NET</strong> platform, the exception raised reads &#8220;<code><a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.net.sockets.socketexception.aspx" title="SocketException">System.Net.Sockets.SocketException</a>: Only one usage of each socket address (protocol/network address/port) is normally permitted &lt;host&gt;:&lt;port&gt;</code>&#8220;. </p>
<p><strong>In Java</strong>, the exception is &#8220;<code><a target="_blank" href="http://java.sun.com/javase/6/docs/api/java/net/BindException.html" title="Java BindException">java.net.BindException</a>: Address already in use: connect</code>&#8220;. </p>
<p>Both exceptions are misleading because they are generally associated with server socket conflicts – not outbound client socket connections.  However, a better understanding of the <a target="_blank" href="http://www.night-ray.com/TCPIP_State_Transition_Diagram.pdf" title="TCP Finite State Machine">TCP state machine</a> sheds some light on this behavior - and a solution.</p>
<p> <a href="http://www.gavaghan.org/blog/2010/02/17/tcpip-parameter-tuning-for-rapid-client-connections/#more-69" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gavaghan.org/blog/2010/02/17/tcpip-parameter-tuning-for-rapid-client-connections/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The .NET Asynchronous I/O Design Pattern</title>
		<link>http://www.gavaghan.org/blog/2010/02/11/the-net-asynchronous-io-design-pattern/</link>
		<comments>http://www.gavaghan.org/blog/2010/02/11/the-net-asynchronous-io-design-pattern/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 19:08:49 +0000</pubDate>
		<dc:creator>Mike Gavaghan</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<category><![CDATA[CodeProject]]></category>

		<guid isPermaLink="false">http://www.gavaghan.org/blog/2010/02/11/the-net-asynchronous-io-design-pattern/</guid>
		<description><![CDATA[Asynchronous operations allow a program to perform time consuming tasks on a background thread while the main application continues to execute.  For example, consider when a program makes a request to a remote system.  In a single-threaded scenario, the call is made and the CPU goes idle as the caller waits on the server's processing time and the network latency.  If this waiting time can be delegated to a separate thread of execution, the program can complete other tasks until it receives notification the background work is complete.

However, managing multiple threads and cross-thread communication adds complexity to your code.  Fortunately, the .NET Framework has a useful design pattern applied to its I/O classes which easily enables asynchronous calls.  Let's take a look at an example.]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://en.wikipedia.org/wiki/Asynchronous_I/O" title="Asynchronous I/O">Asynchronous operations</a> allow a program to perform time consuming tasks on a background thread while the main application continues to execute.  For example, consider when a program makes a request to a remote system.  In a single-threaded scenario, the call is made and the CPU goes idle as the caller waits on the server&#8217;s processing time and the network latency.  If this waiting time can be delegated to a separate thread of execution, the program can complete other tasks until it receives notification the background work is complete.</p>
<p>However, managing multiple threads and cross-thread communication adds complexity to your code.  Fortunately, the .NET Framework has a useful design pattern applied to its I/O classes which easily enables asynchronous calls.  Let&#8217;s take a look at an example.</p>
<p> <a href="http://www.gavaghan.org/blog/2010/02/11/the-net-asynchronous-io-design-pattern/#more-68" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gavaghan.org/blog/2010/02/11/the-net-asynchronous-io-design-pattern/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Understanding SSL – Part 1: Certificates and Keys</title>
		<link>http://www.gavaghan.org/blog/2009/10/14/understanding-ssl-%e2%80%93-part-1-certificates-and-keys/</link>
		<comments>http://www.gavaghan.org/blog/2009/10/14/understanding-ssl-%e2%80%93-part-1-certificates-and-keys/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 01:35:00 +0000</pubDate>
		<dc:creator>Mike Gavaghan</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<category><![CDATA[CodeProject]]></category>

		<guid isPermaLink="false">http://www.gavaghan.org/blog/2009/10/14/understanding-ssl-%e2%80%93-part-1-certificates-and-keys/</guid>
		<description><![CDATA[The technology behind Secure Sockets Layer (SSL) network connections is often perceived as a bit of &#8220;black magic&#8221; – smoke and mirrors securing our Internet connections from snooping.  When banking and shopping online, even a novice user understands their browser sets up an HTTPS connection (which is simply HTTP over SSL) to protect the transaction.  [...]]]></description>
			<content:encoded><![CDATA[<p>The technology behind <a target="_blank" href="http://en.wikipedia.org/wiki/Transport_Layer_Security" title="Transport Layer Security">Secure Sockets Layer (SSL)</a> network connections is often perceived as a bit of &#8220;black magic&#8221; – smoke and mirrors securing our Internet connections from snooping.  When banking and shopping online, even a novice user understands their browser sets up an <a target="_blank" href="http://en.wikipedia.org/wiki/Https" title="HTTP Secure">HTTPS</a> connection (which is simply HTTP over SSL) to protect the transaction.  It’s easy to simply surf to a secure URL and know that, somehow, SSL is magically keeping you safe.</p>
<p>Developing software that <em>uses </em>SSL is an entirely different matter.  The simplicity quickly fades, and the developer must confront the complexities of certificate management, trust stores, handshaking, and a host of other details that must be perfectly aligned to make the secure communication work.  In Part 1, we’ll cover a very high level of SSL concepts.  In subsequent posts, we’ll take a deeper dive into making these connections happen in both Java and C#.</p>
<p> <a href="http://www.gavaghan.org/blog/2009/10/14/understanding-ssl-%e2%80%93-part-1-certificates-and-keys/#more-59" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gavaghan.org/blog/2009/10/14/understanding-ssl-%e2%80%93-part-1-certificates-and-keys/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Liquid Cooling a PC: Gimmick or Necessity?</title>
		<link>http://www.gavaghan.org/blog/2009/10/06/liquid-cooling-a-pc-gimmick-or-necessity/</link>
		<comments>http://www.gavaghan.org/blog/2009/10/06/liquid-cooling-a-pc-gimmick-or-necessity/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 02:54:03 +0000</pubDate>
		<dc:creator>Mike Gavaghan</dc:creator>
		
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://www.gavaghan.org/blog/2009/10/06/liquid-cooling-a-pc-gimmick-or-necessity/</guid>
		<description><![CDATA[Early PCs seldom had more than a tiny, weak fan on the back of the case to push out excess heat generated by the internal electronics.  As transistors shrank and chips grew faster and more complex, CPUs began running hotter and reaching dangerous temperatures - so hot, in fact, that the little case fan couldn't protect the delicate electronics from burning out.

To address this, PC manufacturers began adding fans dedicated to cooling this nerve center of the motherboard.  Today, with high end gaming machines consuming up to 1000W or more, enormous heat is generated not just by the CPU, but by the memory, north and south bridges, and the graphics card.  To expel this heat from inside the case, larger and faster case fans are needed to keep everything running at a safe, relatively cool temperature.

For the past few years, PC accessory vendors have been marketing liquid cooling systems.  These products promise to cool more efficiently, and more quietly, than traditional fans - at the same time adding several hundred dollars to the total price tag of a new machine.  The question is: is this just a pricey gimmick, or is this the next logical step in the progression of ever more powerful machines?]]></description>
			<content:encoded><![CDATA[<p>Early PCs seldom had more than a tiny, weak fan on the back of the case to push out excess heat generated by the internal electronics.  As transistors shrank and chips grew faster and more complex, CPUs began running hotter and reaching dangerous temperatures - so hot, in fact, that the little case fan couldn&#8217;t protect the delicate electronics from burning out.</p>
<p>To address this, PC manufacturers began adding fans dedicated to cooling this nerve center of the motherboard.  Today, with high end gaming machines consuming up to 1000W or more, enormous heat is generated not just by the CPU, but by the memory, north and south bridges, and the graphics card.  To expel this heat from inside the case, larger and faster case fans are needed to keep everything running at a safe, relatively cool temperature.</p>
<p>For the past few years, PC accessory vendors have been marketing <a target="_blank" href="http://en.wikipedia.org/wiki/Water_cooling" title="Water Cooling">liquid cooling </a>systems.  These products promise to cool more efficiently, and more quietly, than traditional fans - at the same time adding several hundred dollars to the total price tag of a new machine.  The question is: is this just a pricey gimmick, or is this the next logical step in the progression of ever more powerful machines?</p>
<p> <a href="http://www.gavaghan.org/blog/2009/10/06/liquid-cooling-a-pc-gimmick-or-necessity/#more-62" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gavaghan.org/blog/2009/10/06/liquid-cooling-a-pc-gimmick-or-necessity/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Kill Spam With Real-Time DNS Blacklists</title>
		<link>http://www.gavaghan.org/blog/2008/06/11/kill-spam-with-real-time-dns-blacklists/</link>
		<comments>http://www.gavaghan.org/blog/2008/06/11/kill-spam-with-real-time-dns-blacklists/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 19:27:43 +0000</pubDate>
		<dc:creator>Mike Gavaghan</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.gavaghan.org/blog/2008/06/11/kill-spam-with-real-time-dns-blacklists/</guid>
		<description><![CDATA[A great Open Source project for gaining understanding about e-mail systems, including an in-depth look at SMTP and POP3, is the Java-based Apache JAMES Project.  Although JAMES has the unfortunate shortcoming of being built around the now defunct and unsupported Apache Avalon Framework, it’s still a fantastic learning tool for understanding email protocols, mail delivery, and spam filtering.  Not only that, it’s a fully functional, enterprise-ready mail server that can be up and running with minimal configuration.

One technology implemented by JAMES for spam filtering is real-time DNS blacklists.  DNSBLs identify the IP addresses of potential spam sources or machines known to be delivering spam (as determined by the sometimes controversial policies of the list owner).  Spam blacklists date back to 1996 with Paul Vixie’s Mail Abuse Prevention System, and are now used by ISPs and corporate mail systems around the world.  Countless organizations maintain blacklists, and Web sites like MX Toolbox permit ad hoc queries of IP addresses against dozens of published lists.]]></description>
			<content:encoded><![CDATA[<p>A great Open Source project for gaining understanding about e-mail systems, including an in-depth look at SMTP and POP3, is the Java-based <a target="_blank" href="http://james.apache.org/" title="Apache JAMES">Apache JAMES Project</a>.  Although JAMES has the unfortunate shortcoming of being built around the now defunct and unsupported <a target="_blank" href="http://avalon.apache.org/closed.html" title="Apache Avalon Project">Apache Avalon Framework</a>, it’s still a fantastic learning tool for understanding email protocols, mail delivery, and spam filtering.  Not only that, it’s a fully functional, enterprise-ready mail server that can be up and running with minimal configuration.</p>
<p>One technology implemented by JAMES for spam filtering is real-time DNS blacklists.  DNSBLs identify the IP addresses of potential spam sources and machines known to be delivering spam (as determined by the sometimes controversial policies of the list owner).  Spam blacklists date back to 1996 with Paul Vixie’s <a target="_blank" href="http://en.wikipedia.org/wiki/Mail_Abuse_Prevention_System" title="Mail Abuse Prevention System">Mail Abuse Prevention System</a>, and are now used by ISPs and corporate mail systems around the world.  Countless organizations maintain blacklists, and Web sites like <a target="_blank" href="http://www.mxtoolbox.com/" title="MX Toolbox">MX Toolbox</a> permit ad hoc queries of IP addresses against dozens of published lists.</p>
<p> <a href="http://www.gavaghan.org/blog/2008/06/11/kill-spam-with-real-time-dns-blacklists/#more-58" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gavaghan.org/blog/2008/06/11/kill-spam-with-real-time-dns-blacklists/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Got Requirements?  If Not, You&#8217;re Doomed</title>
		<link>http://www.gavaghan.org/blog/2008/03/31/got-requirements-if-not-youre-doomed/</link>
		<comments>http://www.gavaghan.org/blog/2008/03/31/got-requirements-if-not-youre-doomed/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 11:31:07 +0000</pubDate>
		<dc:creator>Mike Gavaghan</dc:creator>
		
		<category><![CDATA[Commentary]]></category>

		<guid isPermaLink="false">http://www.gavaghan.org/blog/2008/03/31/got-requirements-if-not-youre-doomed/</guid>
		<description><![CDATA[Yet another software development disaster is headed for the digital trash heap of failed projects.  This time, the casualty is software funded by the U. S. Census Bureau.  The Associated Press reports failure to deliver usable software to census enumerators could add as much as $2 billion to the 2010 census. Worse, the AP reports "census officials are considering a return to using paper and pencil to count every man, woman and child in the nation."

This is a spectacular train wreck that had doom written all over it from Day One.  It’s a familiar, predictable pattern constantly repeated since the first clueless manager commanded "just make it user friendly".]]></description>
			<content:encoded><![CDATA[<p>Yet another software development disaster is headed for the digital trash heap of failed projects.  This time, the casualty is software funded by the <a href="http://www.census.gov/" title="U. S. Census Bureau" target="_blank">U. S. Census Bureau</a>.  <a href="http://www.cnn.com/2008/TECH/03/26/census.problems.ap/index.html" title=" Fancy computers spell trouble for 2010 census" target="_blank">The Associated Press reports</a> failure to deliver usable software to census enumerators could add as much as $2 billion to the 2010 <a href="http://en.wikipedia.org/wiki/Census#United_States" title="United States Census" target="_blank">census</a>. Worse, the AP reports &#8220;census officials are considering a return to using paper and pencil to count every man, woman and child in the nation.&#8221;</p>
<p>This is a spectacular train wreck that had doom written all over it from Day One.  It’s a familiar, predictable pattern constantly repeated since the first clueless manager commanded &#8220;just make it user friendly&#8221;.</p>
<p> <a href="http://www.gavaghan.org/blog/2008/03/31/got-requirements-if-not-youre-doomed/#more-57" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gavaghan.org/blog/2008/03/31/got-requirements-if-not-youre-doomed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JUnit Factory Part 3: Improving Code Coverage</title>
		<link>http://www.gavaghan.org/blog/2008/02/10/junit-factory-part-3-improving-code-coverage/</link>
		<comments>http://www.gavaghan.org/blog/2008/02/10/junit-factory-part-3-improving-code-coverage/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 03:49:47 +0000</pubDate>
		<dc:creator>Mike Gavaghan</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.gavaghan.org/blog/2008/02/10/junit-factory-part-3-improving-code-coverage/</guid>
		<description><![CDATA[JUnit Factory is rather clever how it analyzes and executes your code to generate characterization tests. However, legacy Java code was generally not written with testability in mind. This sometimes makes it difficult for JUnit Factory to attain complete coverage of your code due to the need for objects to exist in a complex state or the need to interact with an external resource such as a database.

JUnit Factory is often able to generate mock instances automatically  for problematic classes. When automocking fails, the developer can improve coverage by either extracting behaviors into private methods or by providing hints to JUnit Factory in the form of test data helpers.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.junitfactory.com" title="JUnit Factory" target="_blank">JUnit Factory</a> is rather clever how it analyzes and executes your code to generate characterization tests. However, legacy Java code was generally not written with testability in mind. This sometimes makes it difficult for JUnit Factory to attain complete coverage of your code due to the need for objects to exist in a complex state or the need to interact with an external resource such as a database.</p>
<p>JUnit Factory is often able to generate mock instances automatically  for problematic classes.  When automocking fails, the developer can improve coverage by either extracting behaviors into private methods or by providing hints to JUnit Factory in the form of test data helpers.</p>
<p> <a href="http://www.gavaghan.org/blog/2008/02/10/junit-factory-part-3-improving-code-coverage/#more-54" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gavaghan.org/blog/2008/02/10/junit-factory-part-3-improving-code-coverage/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JUnit Factory Part 2: Finding Regressions</title>
		<link>http://www.gavaghan.org/blog/2008/01/24/junit-factory-part-2-finding-regressions/</link>
		<comments>http://www.gavaghan.org/blog/2008/01/24/junit-factory-part-2-finding-regressions/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 02:59:34 +0000</pubDate>
		<dc:creator>Mike Gavaghan</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.gavaghan.org/blog/2008/01/24/junit-factory-part-2-finding-regressions/</guid>
		<description><![CDATA[Characterization tests provide a safety net for your legacy Java code by helping identify unintended changes in software behavior caused by code maintenance.  JUnit Factory (http://www.junitfactory.com) from Agitar Software (http://www.agitar.com) may be used to automatically generate these tests for you.  In this post, we’ll take a look at what happens to these characterization tests when a simple code change is made.]]></description>
			<content:encoded><![CDATA[<p>Characterization tests provide a safety net for your legacy Java code by helping identify unintended changes in software behavior caused by code maintenance.  <a href="http://www.junitfactory.com/" onclick="javascript:urchinTracker('/outgoing/junitfactory');" title="JUnit Factory" target="_blank">JUnit Factory</a> from <a href="http://www.agitar.com/" onclick="javascript:urchinTracker('/outgoing/agitar');" title="Agitar Software" target="_blank">Agitar Software</a> may be used to automatically generate these tests for you.  In this post, we’ll take a look at what happens to these characterization tests when a simple code change is made.</p>
<p> <a href="http://www.gavaghan.org/blog/2008/01/24/junit-factory-part-2-finding-regressions/#more-52" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gavaghan.org/blog/2008/01/24/junit-factory-part-2-finding-regressions/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
