Posts

Showing posts with the label Client

Multithread client-server app

Image
Little c/s app with an ugly AWT gui. But it's a nice multithread/socket/awt exercise. This application simply adds two numbers. The operation itself needs to be performed on the server, which accepts two assemblies and delivers the result to client. The client component consists of two input fields, the startup key and the field to show the result of the operation. The server component needs to receive data from the client, to parse them and perform calculations, and finally deliver the solution to the client. It's done within a single project.   Main.java 1: /* 2: * Djordje Gavrilovic 3: * Mar 23, 2017 4: */ 5: package ajpa1; 6: 7: public class Main { 8: public static void main(String[] args) { 9: Server s = new Server(); 10: Klijent k = new Klijent(); 11: 12: s.start(); 13: k.start(); 14: 15: } 16: 17: } Klijent.java 1: package ajpa1; 2: 3: import java.io.IOE...