diff --git a/src/main/java/connect/src/ClientThread.java b/src/main/java/connect/src/ClientThread.java new file mode 100644 index 0000000..78fd366 --- /dev/null +++ b/src/main/java/connect/src/ClientThread.java @@ -0,0 +1,29 @@ +package connect.src; + +public class ClientThread extends Thread { + private static final String className = "ClientThread"; + + public void run() { + // Get connection data from ui + // Connect to server + // Send data depending on information received from ui + // Handle reply of server, process data and display on ui + // Close connection to server before ui is getting closed + + printMessage("Call testConnection."); + testConnection(); + //sconn(fd=4, family=, type=, laddr=addr(ip='127.0.0.1', port=5000), raddr=addr(ip='127.0.0.1', port=33828), status='ESTABLISHED', pid=26828) + } + + private void testConnection() { + Client client = new TLSClient(new TLSClientInformation("cacerts", "qwerty".toCharArray())); + client.createConnection(); + client.sendData(null); + client.receiveData(); + client.closeConnection(); + } + + private static void printMessage(String message) { + System.out.println(className + ": " + message); + } +}