Could you guys give some idea where and how to set it? (Sorry I'm a beginner of POCO.) Specifically, if I set a timeout value, say, 2 seconds, the program should continue to do the left jobs in 2 seconds.

hardegg wrote:Could you guys give some idea where and how to set it? (Sorry I'm a beginner of POCO.) Specifically, if I set a timeout value, say, 2 seconds, the program should continue to do the left jobs in 2 seconds.

Can't do that with URIStreamOpener. If you want your main thread to continue while opener is fetching URI, run it in separate thread. Alternatively, you can use HTTPClientSession, which allows you to pass in your own socket with the timeout set.

hardegg wrote:Could you guys give some idea where and how to set it? (Sorry I'm a beginner of POCO.) Specifically, if I set a timeout value, say, 2 seconds, the program should continue to do the left jobs in 2 seconds.

Can't do that with URIStreamOpener. If you want your main thread to continue while opener is fetching URI, run it in separate thread. Alternatively, you can use HTTPClientSession, which allows you to pass in your own socket with the timeout set.

Thanks Alex. Multithreading is the last choice since I'm not familiar about it. I'll turn to "HTTPClientSession". By the way, one more question about URIStreamOpener. Isn't there a default timeout value for the "open" method, although we cannot set it manualy?