Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » Doubt with timeout in HttpRequest
Re: Doubt with timeout in HttpRequest [message #36130 is a reply to message #36119] Wed, 02 May 2012 08:01 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14265
Registered: November 2005
Ultimate Member
koldo wrote on Mon, 30 April 2012 04:05

Hello Mirek

HttpRequest is subclass of TcpSocket. Both have a timeout member.

In HttpRequest it is set to 120000 and in TcpSocket it is set to Null.

The problem is that doing a HttpRequest::RequestTimeout(int ms) does not change TcpSocket::timeout, so for example HttpRequest::SendingData() will not work properly, as it calls TcpSocket::Put().

So it seems to set a timeout it is necessary to do this:
	HttpRequest http;
	http.RequestTimeout(mytime);
	http.Timeout(mytime);

Is it ok?



Actually, it is more complicated. First of all, it is true it now does not work as it should in case that TcpSocket has Null timeout.

Anyway, there is a difference between TcpSocket::Timeout and RequestTimeout. Timeout is for single socket operation, RequestTimeout is meant to be total timeout for the whole request.

So it will need a little bit more to resolve...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem with includes in Socket.cpp and Web.h
Next Topic: Set thread priority for linux
Goto Forum:
  


Current Time: Sun Jul 06 17:08:45 CEST 2025

Total time taken to generate the page: 0.03065 seconds