added BudaClientServerStuff, an example for some client server functionality.

This commit is contained in:
Jonas
2022-03-11 10:10:14 +01:00
parent eeb259af92
commit 687e68be6c
14 changed files with 222 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import java.io.*;
import java.net.Socket;
public class BudaClient {
public static void main(String[] args) {
Socket sock = null;
try {
sock = new Socket("localhost", 8090);
OutputStream out= sock.getOutputStream();
BufferedReader conin = new BufferedReader(new InputStreamReader(System.in));
String line = "";
while (true) {
line = conin.readLine();
out.write(line.getBytes());
if (line.equalsIgnoreCase("Quitx")) {
break;
}
//line.startsWith() //todo: automatically handle name lengths
//TODO: Implement inputStream in.
}
} catch (IOException e) {
e.printStackTrace();
}
}
}