Academic Master

Computer Sciences

UDP Client/Server Application

The UDP Client Server Application has been designed and developed using java. There are two applications: a client and a server. The datagram packets have been continuously received over a datagram socket. The packet received by the server from a client consists of a mobile number, pin, reason, date, and client IP address. As soon as the packet is received by the server, the information in the packet is validated according to the stored data. If the information is valid or invalid, the server sends the message back to the client. For example, if the information is valid, it sends a success message other it sends a message telling about invalid data. The server also maintains the log file. The server collects the packets in the array and sorts them, and saves them into the log file.

Two classes implement the server application: and Similarly, two classes implement client applications. and There is another class known as that is used by the server. The server used this class to update the log file after every two seconds.

The program folder includes numerous files. The files with the .java extension contain the code. To run the UDP Client/ Server application, follow the below steps:

  1. Open Command Prompt (CMD).
  2. Specify the folder location.
  3. Compile and files by writing javac and javac in CMD.
  4. Now Run both the compiled files by typing java startServer and java startClient.
  5. The server and client window open in front of you.

  1. The client window asks the user to specify the school location. Click on the “OK” button to continue the process or click the cancel button to end the application.

  1. After clicking the “Ok” button, the current window will close, and another client window will open. This window asks the user to enter a mobile number and pin number. It also asks to select the reason from the drop-down menu.

  1. Click on the “Ok” button to send the information to the server.
  2. The server then validates the information and sends back the validation message accordingly.

  1. The server then shows the packet send to it in its window and maintains the log.

  1. The log is updated after every two seconds.
  2. The clear button on the server window clears the server window and log file.

If the server is not responding or working. Then there will be no communication between client and server. The messages will not be sent to the server. The server will be unable to validate the data. Hence there will be no operations.

This application can be used by companies to keep the record of their employee for their check-in and checkout timings.



Calculate Your Order

Standard price





Pop-up Message