Question about Http Requests (HttpWebRequest)

  • Thread starter Thread starter Alan
  • Start date Start date
A

Alan

Hi,

I am trying to write a class in C# that inherits from the
HttpWebRequest class to allow me to do dynamic binding (late binding)
of lower level methods.

For example, I would like to be able to figure out how long it takes
for the DNS resolution to take place. I assume that somewhere in the
HttpWebRequest (or inside a parent object) a call takes place to
resolve DNS? I would like to override this method to allow me to
calculate the time taken to complete this process. i.e. grab the time
before the call to resolve the DNS and grab the time when it returns.

Looking at the public methods in the HttpWebRequest class, and those
that it inherits from, I can't see anything obvious to allow me to do
this. I really would like to achieve this with one of the higher level
classes available in the .Net Framework, rather than having to resort
to using sockets (I need support for cookies, SSL, etc. and I don't
want to "reinvent the wheel").

Does anyone have any pointers as to where I should start looking?

Thanks in advance

Alan.
 
Hello

Unfortunately you can't. I had a similar problem. I wanted to choose which
local IP address the underlying socket should bind to. I couldn't do it, I
even looked at ROTOR source code to understand how it works, my conclusion
was that if I wanted to change anything, I have to rewrite the whole thing,
which is not practical of course.

Best regards,
Sherif
 
Back
Top