I'm working on an application to act as a 'wrapper' around another another application, in this case I'm working on a wrapper in java to go around a TF2 server. However, I'm running into a rather odd issue with getting the output from the console to appear. Even if I redirect the error stream so that it will go with the input stream, the output to console will cut off after a certain point. I can connect to the server in TF2, so I know for a fact that it's launched.
The code for the wrapper:
public class TF2Wrapper {
public static void main(String[] args) throws IOException {
ProcessBuilder process = new ProcessBuilder("./srcds_run","+map pl_badwater","+port 27015","2>&1");
process.redirectErrorStream(true);
Process server = process.start();
BufferedReader inputStream = new BufferedReader(new InputStreamReader(server.getInputStream()));
String s;
while((s = inputStream.readLine()) != null)
{
System.out.println(s);
}
}
It will read the output up until the second time this line appears: 'Calling BreakpadMiniDumpSystemInit',then no further console output appears, or atleast is picked up by the application.
Is there anything I can do to fix this or is that not possible?
Edit: My guess is it has something to do with the buffering, as trying to do this with python works fine.