poco icon indicating copy to clipboard operation
poco copied to clipboard

HTTPClientSession::receiveResponse() not timing out on Windows

Open MarcusTomlinson opened this issue 2 years ago • 3 comments

I have the same code compiled on Windows and macOS:

Poco::Net::HTTPClientSession session( "localhost", 9894 );
session.setTimeout( Poco::Timespan( 0, 100 ) );

...

std::ostream& reqOs = session.sendRequest( req );

...

Poco::Net::HTTPResponse res;
std::istream& resIs = session.receiveResponse( res );

(localhost:9894 waits for 10 seconds in it's HTTPRequestHandler before returning)

On macOS receiveResponse() throws TimeoutException after 100ms as expected, but on Windows it will block for the full 10s and return the stream happily.

MarcusTomlinson avatar Jul 07 '22 15:07 MarcusTomlinson

Hmmm, so it appears that, if I set the timeout to 1s or more, it works.

MarcusTomlinson avatar Jul 07 '22 16:07 MarcusTomlinson

I also observed a timeout issues (with SSL connections) on Windows, see #3806 - it could be that these are related

Please state the library and OS versions that your are using and whether you use plain HTTP, HTTPS with NetSSL_Win, or HTTPS with NetSSL_OpenSSL.

jngrb avatar Sep 20 '22 17:09 jngrb

I experienced this on Windows 11, using POCO 1.11.3 with plain HTTP.

MarcusTomlinson avatar Sep 20 '22 18:09 MarcusTomlinson

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Sep 24 '23 02:09 github-actions[bot]

This issue was closed because it has been inactive for 60 days since being marked as stale.

github-actions[bot] avatar Nov 23 '23 02:11 github-actions[bot]