[ https://issues.apache.org/jira/browse/GEODE-5337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16520201#comment-16520201 ]
Juan José Ramos Cassella commented on GEODE-5337: ------------------------------------------------- This certainly seems to be a bug within the documentation. The source code explicitly includes the {{endPort}} value as part of the possible options, and this algorithm hasn't changed since the very beginning: {code:java} public static int getRandomAvailablePortInRange(int rangeBase, int rangeTop, int protocol) { int numberOfPorts = rangeTop - rangeBase; // do "5 times the numberOfPorts" iterations to select a port number. This will ensure that // each of the ports from given port range get a chance at least once int numberOfRetrys = numberOfPorts * 5; for (int i = 0; i < numberOfRetrys; i++) { int port = rand.nextInt(numberOfPorts + 1) + rangeBase;// add 1 to numberOfPorts so that // rangeTop also gets included if (isPortAvailable(port, protocol, getAddress(protocol))) { return port; } } return -1; } {code} > Geode1.5 end-port is not exclusive when creating a gateway-receiver > -------------------------------------------------------------------- > > Key: GEODE-5337 > URL: https://issues.apache.org/jira/browse/GEODE-5337 > Project: Geode > Issue Type: Bug > Components: docs > Reporter: Cui Chenxiao > Priority: Major > Fix For: 1.5.0 > > > When created, a gateway-receiver shall be assign a range of port to use. > In document > [http://geode.apache.org/docs/guide/16/tools_modules/gfsh/command-pages/create.html#topic_a4x_pb1_dk], > the description for --end-port says "The {{ENDPORT}} value is exclusive > while the {{STARTPORT}} value is inclusive. ". > > However, sometimes, the port number of endport is also assigned to receiver > anyway. Beside, in code for gatewayreceiver, the endport will be randomly > assigned to receiver. > > I supposed this shall be a document bug. -- This message was sent by Atlassian JIRA (v7.6.3#76005)