From e44698d49b9264c61035172ba05dca1cb229fcbc Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Mon, 22 Mar 2021 16:03:07 -0700 Subject: [PATCH] Fix TCP port range (#773) Change-Id: Ifac428efc2a1fd7495e7caded3a9710b806d7696 --- serving/src/main/java/ai/djl/serving/util/Connector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serving/src/main/java/ai/djl/serving/util/Connector.java b/serving/src/main/java/ai/djl/serving/util/Connector.java index eb181d08b01..12fe0a5027b 100644 --- a/serving/src/main/java/ai/djl/serving/util/Connector.java +++ b/serving/src/main/java/ai/djl/serving/util/Connector.java @@ -105,7 +105,7 @@ public static Connector parse(String binding, ConnectorType connectorType) { } else { port = Integer.parseInt(listeningPort); } - if (port >= Short.MAX_VALUE) { + if (port >= 65535) { throw new IllegalArgumentException("Invalid port number: " + binding); } return new Connector(port, false, host, String.valueOf(port), ssl, connectorType);