Question
The programs in Figure 4.3 and Figure 4.4 are available at www.cdk5.net/ipc. Use them to make a test kit to determine the conditions in which
The programs in Figure 4.3 and Figure 4.4 are available at www.cdk5.net/ipc. Use them to make a test kit to determine the conditions in which datagrams are sometimes dropped. Hint: the client program should be able to vary the number of messages sent and their size; the server should detect when a message from a particular client is missed.
Exercise 4.4: Use the program in Figure 4.3 to make a client program that repeatedly reads a line of input from the user, sends it to the server in a UDP datagram message, then receives a message from the server. The client sets a timeout on its socket so that it can inform the user when the server does not reply. Test this client program with the server program in Figure 4.4.
Exercise 4.5: The programs in Figure 4.5 and Figure 4.6 are available at www.cdk5.net/ipc. Modify them so that the client repeatedly takes a line of user’s input and writes it to the stream and the server reads repeatedly from the stream, printing out the result of each read. Make a comparison between sending data in UDP datagram messages and over a stream.
Exercise 4.6: Use the programs developed in Exercise 4.5 to test the effect on the sender when the receiver crashes, and vice-versa.
Submission requirements:
- Submit your source code files (not a zip compressed package) and a readme file details instructions about how to compile and execute your code.
- C/C++, Java, and Python are preferred.
Links for figure: http://www.cdk5.net/wp/extra-material/supplementary-material-for-chapter-4
Step by Step Solution
3.33 Rating (150 Votes )
There are 3 Steps involved in it
Step: 1
package Practice import javanet import javaio public class Client static Integer timeoutLimit 1000 static Integer serverPort 6789 static String server...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Document Format ( 2 attachments)
609a2fa522408_30365.pdf
180 KBs PDF File
609a2fa522408_30365.docx
120 KBs Word File
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started