2011. 11. 1.

InternetSetOption TIMEOUT option

I found  InternetSetoption with 'CONNECT_TIMEOUT' flag.
In my case.  when I used timeout option , I got a error code which is 'only query option'
Googling shows answer. It is that using thread.
But  I resolve problem by using 'CONTROL_RECEIVE_TIMEOUT' option .  because my case is that server response is too slow not connect -error-problem.

If you want to set option 'connect-timeout'  you must use thread-trick.

MSDN : http://support.microsoft.com/kb/224318

In my case :
 
DWORD dTimeout = 3000; // milisec.   
BOOL res = InternetSetOption(m_hInternet, INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT, (void*) &dTimeout, sizeof(dTimeout));
// Check res value. If your function call is success or not. 

댓글 없음:

댓글 쓰기