- // expect: REST server on host 127.0.0.1 port port_number
- response = lineReader.readLine();
- String [] tokens = response.split(" ");
- if (tokens.length == 7 && "port".equals(tokens[5])) {
- port = Integer.parseInt(tokens[6]);
- logger.info("Chimera REST service listening on port "
- + chimeraRestPort);
+ String response = lineReader.readLine();
+ while (response != null)
+ {
+ responses.append("\n" + response);
+ // expect: REST server on host 127.0.0.1 port port_number
+ if (response.startsWith("REST server"))
+ {
+ String[] tokens = response.split(" ");
+ if (tokens.length == 7 && "port".equals(tokens[5]))
+ {
+ port = Integer.parseInt(tokens[6]);
+ break;
+ }
+ }
+ response = lineReader.readLine();