mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-08 23:22:40 +01:00
Fix CPU waste in EngineServer
This commit is contained in:
@@ -149,8 +149,8 @@ public class PortListener {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
byte[] buffer = new byte[4096];
|
||||
while (true) {
|
||||
byte[] buffer = new byte[4096];
|
||||
int len = is.read(buffer);
|
||||
if (len < 0)
|
||||
break;
|
||||
@@ -174,13 +174,11 @@ public class PortListener {
|
||||
shutDownFlag = true;
|
||||
thread.interrupt();
|
||||
ServerSocket ss = serverSocket;
|
||||
if (ss != null) {
|
||||
if (ss != null)
|
||||
close(ss);
|
||||
}
|
||||
Socket s = clientSocket;
|
||||
if (s != null) {
|
||||
if (s != null)
|
||||
close(s);
|
||||
}
|
||||
try {
|
||||
thread.join();
|
||||
} catch (InterruptedException ex) {
|
||||
|
||||
Reference in New Issue
Block a user