"timeout" setting not work in webread function
10 ビュー (過去 30 日間)
古いコメントを表示
Hi:
I use parallel loop to grab data using "webread" , I set up the timeout option to be 10 seconds,
options = weboptions;
options.Timeout = 10;
then use command like below:
timeCost=[];
parfor i=1:1:1e4
tic
webReadTmp=webread(command,options);
timeCost(i)=toc;
end
I use "timeCost" variable to record the time needed for each webread operation. however I notice there are some webread cost more than 30 second, which means the "timeout" setting is not working here.
is there any mistake with my command?
Thanks!
Yu
0 件のコメント
回答 (1 件)
Debadipto
2024 年 9 月 16 日
The "Timeout" setting here specifies the maximum duration to wait for an initial response from the server after sending a request, not an estimate of how long it will take to receive the full response. If the server responds within the timeout duration, you will receive the response; otherwise, a timeout error occurs. It is a safeguard to prevent waiting indefinitely for a response.
In summary, the timeout does not estimate the response time but sets a limit on how long you are willing to wait for a response.
For the definition of "Timeout", please refer to the following MATLAB documentation:
https://www.mathworks.com/help/matlab/ref/weboptions.html#:~:text=Timeout%20%E2%80%94%20Time%20out%20connection%20duration
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Web Services についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!