This is a simple terminal-based client-server attendance system written in C. The system allows clients to connect to a server, mark their attendance, and view the attendance list.
-
Open a terminal and compile the client:
gcc client.c -o client
-
Run the client:
./client
-
Enter your name when prompted to mark attendance.
-
Open another terminal and compile the server:
gcc server.c -o server
-
Run the server:
./server
-
The server listens on port 8080 and stores attendance in a file named
attendance.txt
. Each client connection appends the student's name to the file.
- This is a basic example. In a real-world scenario, consider enhancing security, error handling, and using a database for storing attendance records.
- Ensure that you have the necessary permissions to create and write to files in the working directory.
- The server runs indefinitely; you may manually stop it with a keyboard interrupt (
Ctrl+C
).