Question: Create a simple client/server socket program in Java. The client is a Java GUI that speaks to a server socket running on a desktop machine.
Create a simple client/server socket program in Java. The client is a Java GUI that speaks to a server socket running on a desktop machine. The server side is a Java program with no GUI, just a console program with a main. The server is going to serve up prime numbers whose bit length is specified in the client and sent to the server.
Write a Java server socket that waits for a single connection from a client. When the server receives a connection it reads a bit-length n sent by the client and then generates an n-bit prime integer (that is probably prime) and sends it back to the client. After it sends the integer back to the client, the server socket should close the current connection and wait for another connection.
The client should present a Java GUI to the user that allows them to enter an integer into a text box and then click a button GenPrime that connects to the server, waits for a prime number from the server, and then outputs the prime number into a text area.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
