1 | static URLConnection setURLConnectionDefaultTimeouts(URLConnection con, long timeout) { |
2 | if (con.getConnectTimeout() == 0) { |
3 | con.setConnectTimeout(toInt(timeout)); |
4 | if (con.getConnectTimeout() != timeout) |
5 | print("Warning: URL connect timeout not set by JDK."); |
6 | } |
7 | if (con.getReadTimeout() == 0) { |
8 | con.setReadTimeout(toInt(timeout)); |
9 | if (con.getReadTimeout() != timeout) |
10 | print("Warning: URL read timeout not set by JDK."); |
11 | } |
12 | ret con; |
13 | } |
Began life as a copy of #1002895
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1014802 |
Snippet name: | setURLConnectionDefaultTimeouts |
Eternal ID of this version: | #1014802/1 |
Text MD5: | 752fa7a5fe0a7608254104e1ae5985e9 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-05-02 22:14:50 |
Source code size: | 480 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 384 / 429 |
Referenced in: | [show references] |