<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164917</link>
    <title>MATLAB Central Newsreader - urlread timeout</title>
    <description>Feed for thread: urlread timeout</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sun, 02 Mar 2008 01:45:04 -0500</pubDate>
      <title>urlread timeout</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164917#418468</link>
      <author>Michele </author>
      <description>urlread has a serious problem, at least in R13, in that if&lt;br&gt;
the url you're trying to read doesn't answer, urlread just&lt;br&gt;
hangs without returning an error.  In fact the only way to&lt;br&gt;
regain control is to open the process manager and kill Matlab.&lt;br&gt;
&lt;br&gt;
I tried Fu-Sung Wang's urlread2 which claims to fix this but&lt;br&gt;
it generates the following error:&lt;br&gt;
&lt;br&gt;
img = urlread2('&lt;a href=&quot;http://192.168.0.107/image.jpg&quot;&gt;http://192.168.0.107/image.jpg&lt;/a&gt;', [], [], 5);&lt;br&gt;
??? Undefined variable 'com' or class&lt;br&gt;
'com.mathworks.mlwidgets.html.HTMLPrefs.setProxySettings'.&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; C:\matlab\toolbox\matlab\iofun\urlread2.m&lt;br&gt;
On line 41  ==&amp;gt;&lt;br&gt;
com.mathworks.mlwidgets.html.HTMLPrefs.setProxySettings&lt;br&gt;
&lt;br&gt;
I tried saying&lt;br&gt;
&lt;br&gt;
com.mathworks.services.Prefs.setStringPref('HelpSelectedProducts','MATLAB');&lt;br&gt;
&lt;br&gt;
and then restarting Matlab as suggested in another post, but&lt;br&gt;
that had no effect.&lt;br&gt;
&lt;br&gt;
The author isn't answering his email and I'm really stuck. &lt;br&gt;
Does anyone have a way to read web pages without hanging if&lt;br&gt;
the url is down?  Any help would be greatly appreciated. &lt;br&gt;
Thanks.</description>
    </item>
    <item>
      <pubDate>Tue, 29 Jul 2008 17:27:02 -0400</pubDate>
      <title>Re: urlread timeout</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164917#446101</link>
      <author>Michele </author>
      <description>Nothing?  No one else has this problem?  Anyone?  I could&lt;br&gt;
still use some help with this one.  Thanks.</description>
    </item>
    <item>
      <pubDate>Tue, 29 Jul 2008 17:50:43 -0400</pubDate>
      <title>Re: urlread timeout</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164917#446106</link>
      <author>Peter Boettcher</author>
      <description>&quot;Michele &quot; &amp;lt;denber.nospam@mindspringNOSPAM.com&amp;gt; writes:&lt;br&gt;
&lt;br&gt;
&amp;gt; Nothing?  No one else has this problem?  Anyone?  I could&lt;br&gt;
&amp;gt; still use some help with this one.  Thanks.&lt;br&gt;
&lt;br&gt;
On USENET, your previous post isn't here, so we don't have access to&lt;br&gt;
it.  But I gather you want urlread to timeout gracefully.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
urlread uses a Java class to do the connection.  &quot;edit urlread&quot; and&lt;br&gt;
&quot;edit urlreadwrite&quot; for the code.  Without knowing much about it, the&lt;br&gt;
urlConnection object which is returned by urlreadwrite and used at the&lt;br&gt;
end of urlread has a method &quot;getReadTimeout&quot;, &quot;getConnectTimeout&quot;, and&lt;br&gt;
corresponding &quot;set&quot; methods.  I bet if you modify urlread.m (I would&lt;br&gt;
make yourself a local copy of it, on your MATLAB path, to avoid toolbox&lt;br&gt;
and hashing issues) to set appropriate timeouts for these, things would&lt;br&gt;
work nicely.  You might call your copy urlread_with_timeout.m&lt;br&gt;
&lt;br&gt;
-Peter</description>
    </item>
    <item>
      <pubDate>Tue, 29 Jul 2008 19:01:55 -0400</pubDate>
      <title>Re: urlread timeout</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164917#446119</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;muyfxps1swc.fsf@G99-Boettcher.llan.ll.mit.edu&amp;gt;,&lt;br&gt;
Peter Boettcher  &amp;lt;boettcher@ll.mit.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt;&quot;Michele &quot; &amp;lt;denber.nospam@mindspringNOSPAM.com&amp;gt; writes:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Nothing?  No one else has this problem?  Anyone?  I could&lt;br&gt;
&amp;gt;&amp;gt; still use some help with this one.  Thanks.&lt;br&gt;
&lt;br&gt;
&amp;gt;On USENET, your previous post isn't here, so we don't have access to&lt;br&gt;
&amp;gt;it.&lt;br&gt;
&lt;br&gt;
Amendment: the post had expired at your location, since it was&lt;br&gt;
from the beginning of March.&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&quot;The beauties of conception are always superior to those of&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;expression.&quot;                               -- Walter J. Phillips</description>
    </item>
    <item>
      <pubDate>Sun, 15 Feb 2009 20:05:03 -0500</pubDate>
      <title>Re: urlread timeout</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164917#628434</link>
      <author>bwd </author>
      <description>I struggled with this for a while, until I realized that the timeout time is in milliseconds:&lt;br&gt;
urlConnection.setReadTimeout(5000); % timeout in 5 seconds&lt;br&gt;
&lt;br&gt;
I added this on line 96 or urlread.m (R2006b) and it works.&lt;br&gt;
dave</description>
    </item>
    <item>
      <pubDate>Sun, 07 Sep 2008 21:25:04 -0400</pubDate>
      <title>Re: urlread timeout</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164917#599155</link>
      <author>Michele </author>
      <description>Peter Boettcher &amp;lt;boettcher@ll.mit.edu&amp;gt; wrote in message &amp;lt;muyfxps1swc.fsf@G99-Boettcher.llan.ll.mit.edu&amp;gt;...&lt;br&gt;
&lt;br&gt;
&amp;gt;  Without knowing much about it, the&lt;br&gt;
&amp;gt; urlConnection object which is returned by urlreadwrite and used at the&lt;br&gt;
&amp;gt; end of urlread has a method &quot;getReadTimeout&quot;, &quot;getConnectTimeout&quot;, and&lt;br&gt;
&amp;gt; corresponding &quot;set&quot; methods. &lt;br&gt;
&lt;br&gt;
Thanks for the reply.  Uunfortunately I can't get mine to do that.  I get this:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; urlConnection.getReadTimeout &lt;br&gt;
??? No appropriate method or public field getReadTimeout for class sun.net.www.protocol.http.HttpURLConnection.&lt;br&gt;
&lt;br&gt;
I get the same error when trying setReadTimeout.&lt;br&gt;
&lt;br&gt;
The Sun website Java documentation for urlConnection also does not list these Timeouts.  Is this just not in V6R13 or am I missing something here?  Anyway, this doesn't work for me.&lt;br&gt;
&lt;br&gt;
Any other ideas for preventing an unresponsive server from hanging your Matlab session?  Thanks.</description>
    </item>
  </channel>
</rss>

