This is an online vote casting system using TCP multithreaded server-client program. The voters will log on from client systems and cast their votes.
System should be secure and should only allow clients with authentic name and CNIC to cast the vote.
• A list of registered voters is available in a text file in the following format: Name/CNIC number
The Server shall:
• First of all take the client’s name and CNIC and match it with the content of the text file (Voters_List.txt).
• If the details match, then it will welcome the voter and display the names and poll symbols of the candidates on the terminal.(Candidates_List.txt)
• The voter will then cast the vote by mentioning the poll symbol (not the name) of the candidate. All these details are to be recorded in an output text file. This system should work perfectly for at least 5 different clients at the same time.
• If there is problem of load shedding of electric light, then your system should not lose track of the votes being already casted once your server restarts again when light comes back on.
• Assume that when the record of votes will be written by one thread in an output file, no other thread will make a read to the output file.
• One client can cast a vote ONCE AND ONLY ONCE.
• The Server should allocate a new thread for every new incoming Client.
The client. and server.c files are provided. Just compile each file using the following command on Linux terminal or Windows Bash and run it (For client, obviously replace the server.c filename with client.c). Make sure the server is running before running any client.
gcc –pthread server.c -o server.out
You can get in touch with me on my LinkedIn Profile:
You can also follow my GitHub Profile to stay updated about my latest projects:
If you liked the repo then kindly support it by giving it a star ⭐ and share in your circles so more people can benefit from the effort.
If you find any bugs, have suggestions, or face issues:
- Open an Issue in the Issues Tab to discuss them.
- Submit a Pull Request to propose fixes or improvements.
- Review Pull Requests from other contributors to help maintain the project's quality and progress.
This project thrives on community collaboration! Members are encouraged to take the initiative, support one another, and actively engage in all aspects of the project. Whether it’s debugging, fixing issues, or brainstorming new ideas, your contributions are what keep this project moving forward.
With modern AI tools like ChatGPT, solving challenges and contributing effectively is easier than ever. Let’s work together to make this project the best it can be! 🚀
Copyright (c) 2018-present, harismuneer
Hey there, I'm Haris Muneer 👨🏻💻
-
🕸️ Founder of Cyfy Labs: At Cyfy Labs, we provide advanced social media scraping tools to help businesses, researchers, and marketers extract actionable data from platforms like Facebook, Instagram, and X (formerly Twitter). Our tools support lead generation, sentiment analysis, market research, and various other use cases. To learn more, visit: www.cyfylabs.com
-
🌟 Open Source Advocate: I’m passionate about making tech accessible. I’ve open-sourced several projects that you can explore on my GitHub profile and on the Open Source Software PK page.
-
📫 How to Reach Me: You can learn more about my skills/work at LinkedIn. You can also reach out via email for collaboration or inquiries. For Cyfy Labs related queries, please reach out through the company website.