mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 06:42:56 +00:00
Set connection and read timeouts for HTTP requests
This commit is contained in:
1 parent
b2f705d80a
commit
a1f3ba8fde
1 file changed
+2
@@ -174,6 +174,8 @@ public final class MekanismUtils
|
||||
URL url = new URL(urlToRead);
|
||||
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
|
||||
conn.setRequestMethod("GET");
|
||||
conn.setConnectTimeout(800);
|
||||
conn.setReadTimeout(800);
|
||||
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||
|
||||
while((line = rd.readLine()) != null)
|
||||
|
||||
Reference in new issue
Block a user