A
A
andoral2018-08-17 18:04:10
Windows
andoral, 2018-08-17 18:04:10

Why is the third consecutive request.GetResponse on the same domain never executed (timeout)?

var request = WebRequest.CreateHttp("https://google.com");
var response = request.GetResponse();

request = WebRequest.CreateHttp("https://google.com");
response = request.GetResponse();

request = WebRequest.CreateHttp("https://google.com/chrome");
response = request.GetResponse(); //здесь вылетает по таймауту

By the way, with fiddler all requests respond perfectly.
upd#1
Checked on Ubuntu (on the same PC) - everything is ok.
Problem on Win 7.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Yudakov, 2018-08-17
@andoral

response.Dispose();

E
eRKa, 2018-08-17
@kttotto

And if so?

request.Timeout = Timeout.Infinite;
request.KeepAlive = true;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question