<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Engels Rajangam</title><subtitle type="html" /><id>http://blogs.msdn.com/engelsr/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/engelsr/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/engelsr/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2005-11-29T10:15:00Z</updated><entry><title>Moving to MS IDC, India</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/engelsr/archive/2008/05/27/moving-to-ms-idc-india.aspx" /><id>http://blogs.msdn.com/engelsr/archive/2008/05/27/moving-to-ms-idc-india.aspx</id><published>2008-05-28T02:54:00Z</published><updated>2008-05-28T02:54:00Z</updated><content type="html">&lt;P&gt;Recently I decided to move to India for personal reasons. So I joined Microsoft India Development Center at Hyderabad as a Program Manager. &lt;/P&gt;
&lt;P&gt;I am still traveling&amp;nbsp;to undergo&amp;nbsp;trainings for my new role, but will eventually settle down in Hyderabad (July 2008?).&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8555656" width="1" height="1"&gt;</content><author><name>engelsr</name><uri>http://blogs.msdn.com/members/engelsr.aspx</uri></author></entry><entry><title>System.Net: Intial auto proxy delay resulting in requests failing with "the operation has timed out" exception</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/engelsr/archive/2008/02/13/system-net-intial-auto-proxy-delay-resulting-in-requests-failing-with-the-operation-has-timed-out-exception.aspx" /><id>http://blogs.msdn.com/engelsr/archive/2008/02/13/system-net-intial-auto-proxy-delay-resulting-in-requests-failing-with-the-operation-has-timed-out-exception.aspx</id><published>2008-02-13T17:43:00Z</published><updated>2008-02-13T17:43:00Z</updated><content type="html">&lt;P&gt;Recently I came across an interesting issue. &lt;/P&gt;
&lt;P&gt;A windows service application (originally developed with VS2003/.NET Framework 1.1) is designed to make several HTTP(s) requests in multiple threads simultaneously. With upgrading to VS2008 and recompiling the code, the app started seeing several requests failing with "The operation has timed out" exceptions. &lt;/P&gt;
&lt;P&gt;Taking a System.Net trace (&lt;A href="http://msdn2.microsoft.com/en-us/library/ty48b824(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ty48b824(VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/ty48b824(VS.80).aspx&lt;/A&gt;) showed several threads failing as follows.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;System.Net Verbose: 0 : [6044] WebRequest::Create(&lt;FONT color=#0000ff&gt;&lt;A href="http://www.someserver.com/" mce_href="http://www.someserver.com/"&gt;http://www.someserver.com/&lt;/A&gt;&lt;/FONT&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessId=9616&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime=2008-02-08T21:45:52.3396033Z&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;System.Net Verbose: 0 : [6044] HttpWebRequest#38203409::HttpWebRequest(&lt;A href="http://www.someserver.com/" mce_href="http://www.someserver.com/"&gt;http://www.someserver.com/&lt;/A&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessId=9616&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime=2008-02-08T21:45:52.3396033Z&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;System.Net Verbose: 0 : [6044] Exiting HttpWebRequest#38203409::HttpWebRequest() &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessId=9616&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime=2008-02-08T21:45:52.3396033Z&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;System.Net Verbose: 0 : [6044] Exiting WebRequest::Create() &amp;nbsp; -&amp;gt; HttpWebRequest#38203409&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessId=9616&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime=2008-02-08T21:45:52.3396033Z&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;System.Net Verbose: 0 : [6044] HttpWebRequest#38203409::GetResponse()&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessId=9616&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime=&lt;B&gt;&lt;SPAN style="COLOR: red"&gt;2008-02-08T21:45:52.4021029Z&lt;/SPAN&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;System.Net Information: 0 : [6044] Associating HttpWebRequest#38203409 with ServicePoint#58391824&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessId=9616&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime=&lt;B&gt;&lt;SPAN style="COLOR: red"&gt;2008-02-08T21:46:12.4957243Z&lt;/SPAN&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;System.Net Error: 0 : [6044] Exception in the HttpWebRequest#38203409::EndGetResponse - The operation has timed out&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessId=9616&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime=2008-02-08T21:46:12.4957243Z&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;From the above we can see that the request failed almost immediately with the exception. Taking a network trace I confirmed that the specific request above was not sent over the wire. &lt;/P&gt;
&lt;P&gt;Checking the trace at the beginning I could see that the application started making numerous requests. However before these requests were sent on wire, .NET Framework was trying to detect auto proxy for the urls submitted. This took about 5-7 seconds, by which time there were numerous requests in queue. The timeout set for each request was 20 seconds, however most of them started failing as shown above. &lt;/P&gt;
&lt;P&gt;Since auto proxy detection was added only from 2.0 and above, the application did not see the same problem with 1.1 .NET Framework.&lt;/P&gt;
&lt;P&gt;In this case, the following were the possible solutions.&lt;/P&gt;
&lt;P&gt;1. Disabling auto proxy and configure static proxy in the app.config for the application.&lt;BR&gt;2. Change code to wait for the&amp;nbsp; the first request to complete (including auto proxy). Then start sending the requests from the application. &lt;/P&gt;
&lt;P&gt;In our case, the issue was resolved by disabling auto proxy and setting static proxy in app.config. More information on doing this is available at &lt;A href="http://msdn2.microsoft.com/en-us/library/sa91de1e(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/sa91de1e(VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/sa91de1e(VS.80).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7675774" width="1" height="1"&gt;</content><author><name>engelsr</name><uri>http://blogs.msdn.com/members/engelsr.aspx</uri></author><category term="operation has timed out system.net" scheme="http://blogs.msdn.com/engelsr/archive/tags/operation+has+timed+out+system.net/default.aspx" /></entry><entry><title>Response accumulating Web Filter running into performance issues...</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/engelsr/archive/2006/08/21/response-accumulating-web-filter-running-into-performance-issues.aspx" /><id>http://blogs.msdn.com/engelsr/archive/2006/08/21/response-accumulating-web-filter-running-into-performance-issues.aspx</id><published>2006-08-21T20:03:00Z</published><updated>2006-08-21T20:03:00Z</updated><content type="html">&lt;P&gt;I have come across this specific issue couple of times now. &lt;/P&gt;
&lt;P&gt;A response accumulating web filter (such as WebResponseModifier with the ISA 2004 SDK), does the following.&lt;/P&gt;
&lt;P&gt;1. Accumulates resoponse to client in SF_NOTIFY_SEND_RAW_DATA notification.&lt;BR&gt;2. In SF_NOTIFY_END_OF_REQUEST notification, the filter writes modified or unmodified response to client using WriteClient. &lt;BR&gt;3. WriteClient takes a long time to complete. This is often seen when WriteClient is used to write HTTP status line and headers. &lt;/P&gt;
&lt;P&gt;Note: MSDN docs on WriteClient confirm that web filters may run into performance issues with WriteClient. Please refer the following for more information.&lt;/P&gt;
&lt;P&gt;WriteClient: &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/isasdk/isa/writeclient.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/isasdk/isa/writeclient.asp&lt;/A&gt;&lt;BR&gt;Best Practices: &lt;A href="http://msdn.microsoft.com/library/en-us/isasdk/isa/best_practices_for_web_filters.asp?frame=true"&gt;http://msdn.microsoft.com/library/en-us/isasdk/isa/best_practices_for_web_filters.asp?frame=true&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In IIS ISAPI, it is recommended NOT to use WriteClient for writing status line and headers but to use ServerSupportFunction.&amp;nbsp; This is because IIS does not detect that the response to client includes headers (which may result in IIS not correcting / erroring out if the response HTTP message is not formatted correct), if WriteClient was used. &lt;BR&gt;&lt;BR&gt;In a similar way, the above ISA WriteClient performance issue can be resolved by using ServerSupportFunction instead. This of course adds additional couple of lines of code to your solution, however this is a cleaner and optimal way of writing response to client. &lt;/P&gt;
&lt;P&gt;More info on ServerSupportFunction in ISA SDK is available at &lt;BR&gt;&lt;A href="http://msdn.microsoft.com/library/en-us/isasdk/isa/serversupportfunction.asp?frame=true"&gt;http://msdn.microsoft.com/library/en-us/isasdk/isa/serversupportfunction.asp?frame=true&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Example code snippet:&lt;/P&gt;
&lt;P&gt;char szHeaders [1024] = "Cache-Control: no-cache, no-store\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: 228\r\nServer: Microsoft-IIS/6.0\r\n\r\n";&lt;/P&gt;
&lt;P&gt;pfc-&amp;gt;ServerSupportFunction(pfc, SF_REQ_SEND_RESPONSE_HEADER, (PVOID) "200 OK",&amp;nbsp; (ULONG_PTR) szHeaders, NULL);&lt;/P&gt;
&lt;P&gt;As you can see szHeaders&amp;nbsp;is for adding any additional headers to&amp;nbsp;the response. &lt;/P&gt;
&lt;P&gt;Note: Do not add \r\n at the end of 200 OK (status). &lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=710968" width="1" height="1"&gt;</content><author><name>engelsr</name><uri>http://blogs.msdn.com/members/engelsr.aspx</uri></author></entry><entry><title>Planning to add info on "Underlying connection was closed" errors.</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/engelsr/archive/2005/11/29/497889.aspx" /><id>http://blogs.msdn.com/engelsr/archive/2005/11/29/497889.aspx</id><published>2005-11-29T19:15:00Z</published><updated>2005-11-29T19:15:00Z</updated><content type="html">&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #c0c0c0" color=#0000ff size=2&gt;Planning to add information on "Underlying connection was closed" errors, until a KB article is written.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #c0c0c0" color=#0000ff size=2&gt;This is done. You can read the article here &lt;A HREF="/engelsr/articles/497902.aspx"&gt;http://blogs.msdn.com/engelsr/articles/497902.aspx&lt;/A&gt; &lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=497889" width="1" height="1"&gt;</content><author><name>engelsr</name><uri>http://blogs.msdn.com/members/engelsr.aspx</uri></author></entry></feed>