Skip to content

Commit ef02af5

Browse files
committed
Add DatagramSocketClient.getDefaultTimeoutDuration()
1 parent fc3ed05 commit ef02af5

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/changes/changes.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ The <action> type attribute can be add,update,fix,remove.
6161
Defining changes.version allows one to create the RN without first removing the SNAPSHOT suffix.
6262
-->
6363
<body>
64-
<release version="3.12.1" date="YYYY-MM-DD" description="This is a feature and maintenance release. Java 8 or later is required.">
64+
<release version="3.13.0" date="YYYY-MM-DD" description="This is a feature and maintenance release. Java 8 or later is required.">
6565
<!-- FIX -->
6666
<action type="fix" dev="ggregory" due-to="Henri Biestro, Gary Gregory">org.apache.commons.net.daytime.DaytimeTCPClientTest now should now pass inside most VPNs.</action>
6767
<action type="fix" dev="ggregory" due-to="Jakub Kupczyk">Migrate tests to JUnit5 #358.</action>
6868
<action type="fix" dev="ggregory" due-to="Jakub Kupczyk, Gary Gregory">Migrate tests to JUnit5 - final #359.</action>
6969
<!-- ADD -->
70+
<action type="add" dev="ggregory" due-to="Gary Gregory">Add DatagramSocketClient.getDefaultTimeoutDuration().</action>
7071
<!-- UPDATE -->
7172
<action type="update" dev="ggregory" due-to="Gary Gregory, Dependabot">Bump org.apache.commons:commons-parent from 85 to 93 #371, #388, #389.</action>
7273
<action type="update" dev="ggregory" due-to="Gary Gregory, Dependabot">Bump org.apache.commons:commons-lang3 from 3.18.0 to 3.19.0.</action>

src/main/java/org/apache/commons/net/DatagramSocketClient.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,16 @@ public int getDefaultTimeout() {
125125
return _timeout_;
126126
}
127127

128+
/**
129+
* Gets the default timeout duration that is used when opening a socket.
130+
*
131+
* @return The default timeout duration that is used when opening a socket.
132+
* @since 3.13.0
133+
*/
134+
public Duration getDefaultTimeoutDuration() {
135+
return Duration.ofMillis(_timeout_);
136+
}
137+
128138
/**
129139
* Gets the local address to which the client's socket is bound. If you call this method when the client socket is not open, a NullPointerException is
130140
* thrown.

0 commit comments

Comments
 (0)