Skip to content

Commit acee121

Browse files
committed
Merge branch 'dev' of https://github.com/microsoftgraph/msgraph-sdk-java into feature/time_of_day_deserialization
2 parents 02d6213 + e64e922 commit acee121

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/com/microsoft/graph/http/UrlConnection.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@
3939
*/
4040
public class UrlConnection implements IConnection {
4141

42+
/**
43+
* Default connection read timeout
44+
*/
45+
private static final int DEFAULT_CONNECTION_READ_TIMEOUT_MS = 30_000;
46+
/**
47+
* Default connect timeout
48+
*/
49+
private static final int DEFAULT_CONNECT_TIMEOUT_MS = 30_000;
4250
/**
4351
* The backing HTTP URL connection instance
4452
*/
@@ -63,6 +71,8 @@ public UrlConnection(final IHttpRequest request) throws IOException {
6371
}
6472

6573
connection.setUseCaches(request.getUseCaches());
74+
connection.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT_MS);
75+
connection.setReadTimeout(DEFAULT_CONNECTION_READ_TIMEOUT_MS);
6676

6777
try {
6878
connection.setRequestMethod(request.getHttpMethod().toString());

0 commit comments

Comments
 (0)