<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2164612161799397223</id><updated>2012-02-16T07:26:36.085-08:00</updated><category term='Server'/><category term='NetworkStream'/><category term='TCP'/><category term='.NET'/><title type='text'>JAW Development</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.jawdevelopment.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2164612161799397223/posts/default'/><link rel='alternate' type='text/html' href='http://www.jawdevelopment.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Josh</name><uri>http://www.blogger.com/profile/06045741453016158269</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2164612161799397223.post-1502886719013891402</id><published>2009-09-23T16:28:00.000-07:00</published><updated>2009-09-23T16:44:06.547-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TCP'/><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='NetworkStream'/><title type='text'>An existing connection was forcibly closed by the remote host.</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Usually, this is due to the remote host closing the connection on you, spotty network connections (wireless, 3G, etc). This solution was a new one to me. It turns out that Windows Server 2003 SP2 had an issue with the Scalable Networking Pack. Now to even run into this issue, you need multiple network cards teamed together. Then you need the Scalable Networking Pack installed on top of the Service Pack 2.  Microsoft has instructions on how to fix this issue (&lt;/span&gt;&lt;a href="http://support.microsoft.com/kb/325487"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;link&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;) along with some SQL Server guys having issues with it as well (&lt;/span&gt;&lt;a href="http://blogs.msdn.com/sql_protocols/archive/2008/04/08/understanding-connection-forcibly-closed-by-remote-host-errors-caused-by-toe-chimney.aspx"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;link&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;). To fix it run "&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: 11px; font-weight: bold; line-height: 16px; "&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Netsh int ip set chimney DISABLED"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: 11px; font-weight: bold; line-height: 16px; "&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 16px; "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;on all servers, both client and server, having the issue.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Now the fun .NET code issues after all the technical server stuff is out of the way. We had a client/server TCP connection between two servers sitting right next to each other. We developed code that waited for 15 seconds for the data from the server. The client logged that no data was available, the server logged "&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: 13px; white-space: pre; "&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;An existing connection was forcibly closed by the remote host."&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: 16px; white-space: normal; "&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;, which we thought was impossible. So to diagriam it it went like this.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Client A sends request to Server A&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Server A reads data, starts long running process.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Client A starts loop to wait for data.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Server A finishes long running process writes to the NetworkStream.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Server A throws errors "&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: 13px; white-space: pre; "&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;An existing connection was forcibly closed by the remote host.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: 16px; white-space: normal; "&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: 13px; white-space: pre; "&gt;&lt;span class="Apple-style-span" style="font-size: 16px; white-space: normal; "&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Client A gives up, but still thinks the connection is open and no data is available.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: 13px; white-space: pre; "&gt;&lt;span class="Apple-style-span" style="font-size: 16px; white-space: normal; "&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;So now I won't have to Google for when this comes up again.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2164612161799397223-1502886719013891402?l=www.jawdevelopment.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.jawdevelopment.com/feeds/1502886719013891402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.jawdevelopment.com/2009/09/existing-connection-was-forcibly-closed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2164612161799397223/posts/default/1502886719013891402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2164612161799397223/posts/default/1502886719013891402'/><link rel='alternate' type='text/html' href='http://www.jawdevelopment.com/2009/09/existing-connection-was-forcibly-closed.html' title='An existing connection was forcibly closed by the remote host.'/><author><name>Josh</name><uri>http://www.blogger.com/profile/06045741453016158269</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
