you’ll write two clients (both essentially identical) that will communicate with a server that you will also write. On start-up, each client will print out a string saying: “Client _ of Joan A. Smith” where _ will be either A or B. Your two clients, A and B, will then open a TCP socket to your server and send a message (a string of characters) to your server containing the string “100 Hello”. The server will accept connections from your clients and after it has received messages from both A and B will print their messages and then (only after having received messages from both clients) it will send a message (“105 Candidates str1 str2”) back to your clients. Str1 and str2 will be two strings with the first names of two candidates. At each client the user will then be prompted for a candidate to select. After the user selects that client, the string “110 Vote str” will be sent back to the server, where str will be the name of the candidate chosen. The server will then increment the number of votes for the appropriate candidate. The
server will then send a “200 OK” message back to the appropriate client. The user at each client will be prompted if there are more votes to cast. If the user answers “No,” then the appropriate client will send a “120 Poll Closed” message to the server. Upon receiving that message, the server will send two messages to each client. The first message will say “220 Winner str votes”, where str is the name of the candidate with the highest number of votes. Votes will be the number of votes gained by that candidate. The second message will say “221 Runner-up str votes”, where str is the name of the candidate with the second highest number of votes. Votes will be the number of votes gained by that candidate. After sending these messages, the server will close both of the sockets that it has created for the clients. The server and clients will both terminate.
Your server will create a string containing its name (e.g., “Server of Joan A. Smith”) and then prompt the user for the first names of two candidates. The server will initialize the number of votes for each client at 0. Next, the server will begin accepting connections from clients. When the server receives two “110 Hello” messages from two separate clients, your server will send down to each client the string “105 Candidates str1 str2”, where str1 and str2 are the first names of the candidates that were collected at the server. Whenever the server receives the string “110 Vote str”, where str is the chosen candidate, the server will update the number of votes for the appropriate candidate. The rest of the operation is as described above.
I am a professional Embedded Linux Developer. Mostly worked with Python , shell script and embedded c. Hands on and good understanding of OPERATING SYSTEM. Hands on experience on Socket programming In Python with Li Plus
3 freelance font une offre moyenne de $18 pour ce travail
Hello, I have read the details provided..please contact me to discuss more on the project deadline and some other few things
Read the description, very elaborate. Looking forward to working with you on this project. Ping me to discuss solutions.