Skip to content

Commit

Permalink
fix(protocol): EOFException when client disconnects
Browse files Browse the repository at this point in the history
  • Loading branch information
Misat11 committed Aug 18, 2024
1 parent 0b461dd commit bec9f34
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.EOFException;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
Expand Down Expand Up @@ -135,7 +136,9 @@ public void run() {

}
} catch (IOException e) {
throw new RuntimeException(e);
if (!(e instanceof EOFException)) { // Mute EOF
throw new RuntimeException(e);
}
} finally {
System.out.println("Client " + identifier + " disconnected");
clients.remove(identifier);
Expand Down

0 comments on commit bec9f34

Please sign in to comment.