jbonofre commented on code in PR #1449:
URL: https://github.com/apache/activemq/pull/1449#discussion_r2126028268
##########
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:
Why not returning IAE here ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact