thunder.dragon
Forerunner
Hi Guys,
My friend need to solve one issue as below of Socket Programming. He is on hurry and ready to pay for the same. LOL I can't help as know nothing of the same. LOL
Mods please feel free to let me know if the thread has any issues.
Help Guys!
My friend need to solve one issue as below of Socket Programming. He is on hurry and ready to pay for the same. LOL I can't help as know nothing of the same. LOL
Write two versions of a distributed client-server application. One version using TCP and another version using UDP. The program should perform the following:
1. The client program sends two or more sentences to the server. The server merges the sentences
by placing one word from each sentence in turns. The example below demonstrates how it
works:
Client sends: “first second third fourthâ€
“one two threeâ€
“ten twenty thirty forty fiftyâ€
Server responds with the message:
“first one ten second two twenty third three thirty fourth forty fiftyâ€
2. Client and server follow the following protocol:
1. Before the client starts sending sentences it sends a “hello†message to server.
2. The server responds with either “welcome†or “sorryâ€. You need to program the server so
that the probability to get a “welcome†response is 70%.
3. If the client receives a “sorry†response, it tries again (back to step 1).
4. If the client receives a “welcome†response, it proceeds with sending sentences.
5. Once the client has no more sentences, it sends “end†message
6. When the server receives the “end†message, it merges all the sentences received in one
sentence alternating words from the original sentences (as demonstrated in the example
above), and returns the response back to the client.
3. When writing the TCP version of the program, you don't have to add any code to ensure
reliability (it is done by TCP), and you don't have to maintain the client-server state either since
TCP connection will be open with the same client until it ends the connection (so for simplicity
don't write different threads for the different clients).
4. When writing the UDP version of the program, you have to do more work to ensure reliability
( at least using stop-and-wait behavior). Additionally, you have to do more work to maintain the
state between the client and the server. This is important since UDP doesn't establish a
connection with a particular client, instead it receives individual packets from different clients.
So you need to implement a mechanism to allow the UDP server to distinguish between the
sentences coming from the different clients.
Mods please feel free to let me know if the thread has any issues.
Help Guys!