dk2k commented on code in PR #1449:
URL: https://github.com/apache/activemq/pull/1449#discussion_r2128740296


##########
activemq-client/src/main/java/org/apache/activemq/transport/tcp/QualityOfServiceUtils.java:
##########
@@ -125,15 +126,17 @@ private static int adjustDSCPForECN(int dscp)
         // The only way to see if there are any values set for the ECN is to
         // read the traffic class automatically set by the system and isolate
         // the ECN bits.
-        Socket socket = new Socket();
-        try {
+        try (Socket socket = new Socket()) {
             int systemTrafficClass = socket.getTrafficClass();
             // The 1st and 2nd bits of the system traffic class are the ECN
             // bits.
             return (dscp << 2) | (systemTrafficClass & 3);
         } catch (SocketException e) {
             throw new IllegalArgumentException("Setting Differentiated 
Services"
                 + " not supported: " + e);
+        } catch (IOException e) {

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to