2 Commits
2 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ plugins {
}
group = 'net.pixtaded'
version = '1.0.3'
version = '1.0.4'
repositories {
mavenCentral()
@@ -38,7 +38,6 @@ public class CrabClient implements Crab {
try {
if (this.serverAddress == null)
setup();
connect();
communicate();
} catch (IOException e) {
System.err.println("Error connecting to the server: " + e.getMessage());
@@ -97,12 +96,14 @@ public class CrabClient implements Crab {
}
private void sendPacket(byte PID, String argument) throws IOException {
connect();
String formattedMessage = String.valueOf((char) PID) + argument + "\n";
out.print(formattedMessage);
out.flush();
receiveResponse(PID);
closeConnection();
}
private void receiveResponse(byte PID) throws IOException {
@@ -121,8 +122,6 @@ public class CrabClient implements Crab {
} default -> {
}
}
closeConnection();
connect();
}
private void closeConnection() {
@@ -141,7 +140,7 @@ public class CrabClient implements Crab {
}
private void clearScreen() {
System.out.print("\033[H\033[2J");
System.out.print("\033[999999S\033[H\033[2J");
}
}