Skip to content

It turned out wait for a connection to the HTTP-server 'www.google.com' #121

@imrroot

Description

@imrroot

hi im trying to send get or post request with ThreadPool But its show this error always

Error Code = Exception thrown: 'Leaf.xNet.HttpException' in Leaf.xNet.dll ("It turned out wait for a connection to the HTTP-server 'www.google.com'.")

and this is my code

var source;
var userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36";
try{
using (var request = new HttpRequest()
{
IgnoreProtocolErrors = true,
KeepAlive = true,
AllowAutoRedirect = true,
UserAgent = userAgent,
}.AddHeader(HttpHeader.Accept, "text/plain, /"))
{
response = request.Get("https://www.google.com/");
source = response.ToString();
}
}

catch (HttpException)
{
lblerror.Text = (int.Parse(lblerror.Text) + 1).ToString();
}

what is problem ? by the way its work with default thread but with ThreadPool has problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    insufficient infoThere is not enough information about the issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions