Changeset 14063 in osm


Ignore:
Timestamp:
2009-03-12T20:44:08+01:00 (16 years ago)
Author:
hampelratte
Message:

added configurable connect and read timeouts for the http connection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java

    r13673 r14063  
    1616import java.text.NumberFormat;
    1717import java.util.Locale;
     18import java.util.concurrent.TimeUnit;
    1819import java.util.regex.Matcher;
    1920import java.util.regex.Pattern;
     
    2526import org.openstreetmap.josm.data.Bounds;
    2627import org.openstreetmap.josm.data.projection.Projection;
     28import org.openstreetmap.josm.gui.MapView;
    2729import org.openstreetmap.josm.io.ProgressInputStream;
    28 import org.openstreetmap.josm.gui.MapView;
    2930
    3031
     
    119120   
    120121        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
     122        conn.setConnectTimeout(Main.pref.getInteger("wmsplugin.timeout.connect", 30) * 1000);
     123        conn.setReadTimeout(Main.pref.getInteger("wmsplugin.timeout.read", 30) * 1000);
    121124
    122125        String contentType = conn.getHeaderField("Content-Type");
Note: See TracChangeset for help on using the changeset viewer.