-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It turned out wait for a connection to the HTTP-server 'www.google.com' #121
Comments
please answer |
By pure chance, are you using proxies?, try to place a timeout in the HttpRequest configuration, as here https://share.biitez.dev/i/rp7aj.png |
i dont use proxies i told its work with 1 thread but with threadpool throw this error |
I have the same Problem. If I use a Threadpool.SetMinThreads and Threadpool.SetMaxThreads I get the same error. Once removed everything works. I dont understand why this happens. Anyone knows any fix to this? Since I wanna set Threadpool MinThreads but I cant do it using it together with Leaf.xNet.. |
Try using only Threadpool.SetMinThreads & do not set Threadpool.SetMaxThreads. If you are using Parallel.For or Foreach then pass ParallelOptions with Maxdegreeofparallelism as threads count |
Same problem, use threadpool allways raise this exception. |
Hi my problem fixed after adding timeout parameter thread pool worked! |
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
The text was updated successfully, but these errors were encountered: