Skip to content

Commit

Permalink
Added an additional read time-out
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Jul 4, 2012
1 parent e0f8513 commit ee4c4d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -30,7 +30,8 @@ public class Activator extends AbstractUIPlugin {
private ServiceTracker jsFinderTracker;

/** HTTP time out in milliseconds. */
public static final Integer TIME_OUT = 5000;
public static final Integer CONNECT_TIME_OUT = 5000;
public static final Integer READ_TIME_OUT = 30000;

public Activator() {}

Expand Down
Expand Up @@ -127,7 +127,8 @@ public IRDFStore importURL(IRDFStore store, String url,
throws IOException, BioclipseException, CoreException {
URL realURL = new URL(url);
URLConnection connection = realURL.openConnection();
connection.setConnectTimeout(Activator.TIME_OUT);
connection.setConnectTimeout(Activator.CONNECT_TIME_OUT);
connection.setReadTimeout(Activator.READ_TIME_OUT);
connection.setRequestProperty(
"Accept",
"application/xml, application/rdf+xml"
Expand Down Expand Up @@ -393,7 +394,7 @@ public StringMatrix sparqlRemote(
Query query = QueryFactory.create(sparqlQueryString);
monitor.worked(20);
QueryEngineHTTP qexec = (QueryEngineHTTP)QueryExecutionFactory.sparqlService(serviceURL, query);
qexec.addParam("timeout", "" + Activator.TIME_OUT);
qexec.addParam("timeout", "" + Activator.CONNECT_TIME_OUT);
PrefixMapping prefixMap = query.getPrefixMapping();
monitor.worked(60);

Expand Down

0 comments on commit ee4c4d4

Please sign in to comment.