linux tweak, and improving the speed of siphoning System.out

This commit is contained in:
benfry
2003-10-27 04:09:25 +00:00
parent dead46648d
commit 57805dd09f
3 changed files with 23 additions and 7 deletions

View File

@@ -56,9 +56,14 @@ class PdeMessageSiphon implements Runnable {
//System.err.println(currentLine);
}
} catch (Exception e) {
System.err.println("PdeMessageSiphon err " + e);
e.printStackTrace();
//thread.stop(); // implicit (and no longer supported)
// on linux, a "bad file descriptor" message comes up when
// closing an applet that's being run externally.
// use this to cause that to fail silently since not important
if ((PdeBase.platform != PdeBase.LINUX) ||
(e.getMessage().indexOf("Bad file descriptor") == -1)) {
System.err.println("PdeMessageSiphon err " + e);
e.printStackTrace();
}
}
//System.err.println("siphon thread exiting");
}

View File

@@ -75,12 +75,24 @@ public class PdeRuntime implements PdeMessageConsumer {
thread.start();
}
public void run() {
public void run() {
byte boofer[] = new byte[1024];
try {
while (true) {
//int count = input.available();
//int offset = 0;
int count = input.read(boofer, 0, boofer.length);
if (count == -1) break;
System.out.print(new String(boofer, 0, count));
}
/*
int c;
while ((c = input.read()) != -1) {
System.out.print((char) c);
}
*/
} catch (Exception e) {
System.err.println("PdeSystemOutSiphon error " + e);
e.printStackTrace();

View File

@@ -23,12 +23,11 @@ X open the discourse board in another window, ask to post the code
X set PATH to include java (!)
X external classes currently require expert release
_ code written for linux, test it
X code written for linux, test it
_ code written for windows, rebuild the exe and test it
_ update the release of jikes that's used
X updated for macosx
_ compile new version for linux
X compile new version for linux
_ compile new version for windows
_ netscape/javascript had to be included for linux and for expert