String host = Env.getString("repl.host", "localhost"); if (port == 0) { port = server.bindToRandomPort("tcp://" + host); } else { server.bind("tcp://" + host + ":" + port); printHelp(); } else if (Objects.equals("completer", commandName)) { int completerPort = completerSock.bindToRandomPort("tcp://localhost"); threadPool.submit(new CompletionServer(completerSock, jshell.sourceCodeAnalysis(), commandNames)); transport.sendOut(Integer.toString(completerPort));
String host = Env.getString("repl.host", "localhost"); if (port == 0) { port = server.bindToRandomPort("tcp://" + host); } else { server.bind("tcp://" + host + ":" + port); int completerPort = completerSock.bindToRandomPort("tcp://localhost"); threadPool.submit(new CompletionServer(completerSock, commandNames)); transport.sendOut(Integer.toString(completerPort));
String host = Env.getString("repl.host", "localhost"); if (port == 0) { port = server.bindToRandomPort("tcp://" + host); } else { server.bind("tcp://" + host + ":" + port); int completerPort = completerSock.bindToRandomPort("tcp://localhost"); threadPool.submit(new CompletionServer(completerSock, commandNames)); transport.sendOut(Integer.toString(completerPort));
receiver = ctx.createSocket(ZMQ.REP); if (lport == 0){ lport = receiver.bindToRandomPort("tcp://*", 50000, 60000); } else { receiver.bind("tcp://*:"+lport);
/** * Bind to network interface to a random port. Start listening for new * connections. * * @param addr * the endpoint to bind to. */ public int bindToRandomPort(String addr) { return bindToRandomPort(addr, DYNFROM, DYNTO); }
/** * Bind to network interface to a random port. Start listening for new connections. * * @param addr the endpoint to bind to. * @param min_port The minimum port in the range of ports to try. */ public int bindToRandomPort(String addr, int min_port) { return bindToRandomPort(addr, min_port, 20000, 100); }
/** * Bind to network interface to a random port. Start listening for new connections. * * @param addr the endpoint to bind to. * @param min_port The minimum port in the range of ports to try. * @param max_port The maximum port in the range of ports to try. */ public int bindToRandomPort(String addr, int min_port, int max_port) { return bindToRandomPort(addr, min_port, max_port, 100); }
/** * Bind to network interface to a random port. Start listening for new connections. * * @param addr the endpoint to bind to. */ public int bindToRandomPort(String addr) { return bindToRandomPort(addr, 2000, 20000, 100); }