アプリケーションがフリーズするという問題が1つあります。new P2P("string");
重量のあるGUIを使用する場合。
私の混乱は、このwhileループ内でそれを実行するための最良の方法は何ですか?OS全体をフリーズしないように?
ユースケースの例:
public void run() {
while (true) {
byte[] buf = new byte[5024];
int bytes_read = 0;
bytes_read = sockInput.read(buf, 0, buf.length);
String data = null;
data = new String(buf, 0, bytes_read);
System.out.println("[TCP]: incomeing data: " + bytes_read + " bytes, data=" + data);
//
// get some commands on TCP parse it and trigger this
//
new P2P(main.my_info_array);
// After some time the whole OS freeze requires shutdown reboot physically
// how to improve it
}
}