473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

HttpWebRequest.GetResponese() hangs

Hi.
I'm using this code to access an https service:

public class AcceptAllCertificatePolicy : ICertificatePolicy
{
public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate
certificate, WebRequest request, int certificateProblem)
{
return true;
}
}

HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(URL +
strbXMLEncoded);

//.Create(URL + strbXMLEncoded);
myReq.MaximumAutomaticRedirections = 4;
myReq.MaximumResponseHeadersLength = 4;

myReq.Method = "GET";
myReq.ContentLength = URL.Length + strbXMLEncoded.Length;
myReq.ContentType = "application/x-www-form-urlencoded";
HttpWebResponse response = null;
int tmp = ServicePointManager.DefaultConnectionLimit;
try
{
response = (HttpWebResponse)myReq.GetResponse();
}

The last line hangs and never comes back, no exception nothing.
It only happens against a certain server, trying this code with
https://www.gmail.com works fine.

I've looked in wireshark and I got this results:

After Getting Application data and sending an ACK there is a 59 seconds
delay and then I get there more packets:
Encrpted Alert (from the server back to me)
FIN, ACK (from the server back to me)
then I send ACK and RST, ACK.

(in the gmail test I didn't get the Encrypted Alert and no RST at the end...)

This is on wire shark, the visuall studio code is just hanged, no exception
no return from the call.

what can it be ?

Thanks,

Dani
Nov 3 '08 #1
0 1445

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dan Battagin | last post by:
Is there a known bug with the interaction between the HttpWebRequest and the ThreadPool? I current spawn several HttpWebRequest's using BeginGetResponse, and they work for a while, using worker...
1
by: Nick Jacobsen | last post by:
Hoping that someone else has either run into this, or can point me in the right direction to fix it. I am making an PROPFIND HTTP Request to a WebDav Mail server (hotmail,. to be specific) using...
4
by: Mark Fletcher | last post by:
Hi, Im in the process of writing a program that crawls a website. Im using the HttpWebRequest and HttpWebResponse classed to get content. To make my application more scalable, my application is...
6
by: RP | last post by:
Hi all, I have some code that does a basic form post to an .aspx page submitting some XML in the body. This code used to work on my WIN2K server running .net 1.0 sp2. Now since I have upgraded to...
1
by: mwieder | last post by:
The following code hangs at the GetRequestStream after a few loops of succesful execution: while (true) { HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(new Uri(strUri)); ...
2
by: cj | last post by:
As best I can figure this should return me something from the host but it hangs on RESPONSE = REQUEST.GetResponse() Any ideas? Private Sub Button1_Click(ByVal sender As System.Object, ByVal e...
1
by: Blackstar | last post by:
I have a website I am trying to download a file from. This website is strange in the fact that there is no direct link to the URL of the file. The way the site works is as follows: 1) Enter in...
1
by: sbrown | last post by:
I'm sending an HttpWebRequest to a BizTalk server. BizTalk receives and asyncronously processes correctly, but I never receive an http response. The last statement in the snippet below is where my...
4
by: Mahernoz | last post by:
Hi Friends, I have this code in a C# console application which calls a URL on my website(Asp.net/C#) with Querystrings. (I have also tried without querystrings). The problem is my program...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.