IG.NORE PLS,我对此进行了修改,但无法删除
这是我的代码-
static void SendViewLoop()
{
HttpWebRequest httpRequest;
while (true)
{
//do stuff here
//start
for (int i = 3; i > 0; i--)
{
try
{
//create request
httpRequest = (HttpWebRequest)WebRequest.Create("URL");
//httpRequest stuff here like headers, timeout, etc
//start get and dispose
using (HttpWebResponse response = (HttpWebResponse)httpRequest.GetResponse()) { }
//sleep
Thread.Sleep(TimeSpan.FromMinutes(2));
}
catch { continue; }
}
//do stuff here
}
}
尽管它会更改每个请求,但我仍在尝试永久地请求某些内容,但是我不确定如何或是否应该处置httpRequest。是否需要中止httpRequest,例如在等待2分钟的时间内执行某项操作,是否占用了不必要的内存或其他可能的内容?