This project implements a simple client-server application for managing employee data. The server handles requests from clients, such as querying employee information or performing searches based on different criteria. The client provides a graphical user interface (GUI) for users to interact with the server.
The server is implemented in Java and listens for incoming connections on port 7777. When a client connects, the server accepts the connection and handles client requests. It reads input from the client, processes it based on specified criteria, and sends back the results.
The server reads employee data from a text file located at src/main/resources/employee.txt
. It supports three types of queries:
- Search by employee name to determine retirement status.
- Count employees with a specific birthdate.
- Count employees hired on a specific birthdate and date of employment.
The client is also implemented in Java and provides a Swing-based GUI for users to interact with the server. It allows users to select different search options, enter input values, and retrieve results from the server.
The client sends requests to the server based on user input and displays the results in the GUI.
To use this project, follow these steps:
- Clone the repository to your local machine:
git clone https://github.com/decodevm/ihm_tcp_socket.git
- Navigate to the tcp-socket/src/main/java/com/decodev/additional directory:
cd ihm_tcp_socket/src/main/java/com/decodev/additional
- Compile the Java files:
javac EmployeeClient.java EmployeeServer.java
- Run the server for employee system:
java EmployeeServer
- Connect your client application to the server using TCP socket programming:
java EmployeeClient
This project was developed by: