Terminé

Write a python program for TCP server and client communication voting system

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

1

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.

Server Implementation

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.

Compétences : Python, Architecture Logicielle, Linux

en voir plus : tcp server client winsock project, examples boost asio tcp server client, simple tcp server client linux, server client communication using, linux tcp server client, android tcp server client, iphone apps server client communication making faster, simple tcp server client windows form, tcp server client chat program cc, tcp server client windows form, vb tcp server client, secure server client communication, http server client communication

Concernant l'employeur :
( 0 commentaires ) Kingston, Jamaica

Nº du projet : #21579468

Décerné à:

GAMVON

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

%selectedBids___i_sum_sub_7% %project_currencyDetails_sign_sub_8% USD en 4 jours
(0 Commentaires)
0.0

3 freelance font une offre moyenne de $18 pour ce travail

Valuesolutions

Hello, I have read the details provided..please contact me to discuss more on the project deadline and some other few things

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 7 jours
(11 Commentaires)
4.9
sbk97

Read the description, very elaborate. Looking forward to working with you on this project. Ping me to discuss solutions.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 4 jours
(0 Commentaires)
0.0