Modify Example2SenderReceiver.java so that each process sends out its message 10 times. Compile and run. Describe the run outcomes and hand in the program listings.

This exercise is based on Example2 presented in this chapter.
```
>java Example2SenderReceiver 239.1.2.3 1234 msg1
Hit return when ready to send:
Joined group /239.1.2.3 port 1234

Sending to 239.1.2.3 port 1234 10 times
msg1
msg1
msg1
msg1
msg1
msg1
msg1
msg1
msg1
msg1
msg2
(repeated 10 times)
msg3
(repeated 10 times)

```


Each message receives 30 messages, 10 each from each other.
The code:
```
System.out.println("Sending to " + args[0] +
" port " + port + " 10 times");
for (int i=0; i<10; i++)
socket.send(packet);
socket.close();

```

Computer Science & Information Technology

You might also like to view...

Which of the following data types may be used in a switch statement?

a. int b. char c. enum d. long e. all of the above f. a and d

Computer Science & Information Technology

What will be matched by the following ed regular expressions? (Tip: If you're using them in other contexts, you should omit the backslashes

* [0-9]\{3\} xx* [0-9]\{3,5\} x\{5,\} ^\... x\{10\} [A-Za-z_][A-Za-z_0-9]* [0-9]* ^Begin$ [0-9][0-9][0-9] ^\(.\).*\1$

Computer Science & Information Technology

A thin client is a common design for a PC used by a student or child

Indicate whether the statement is true or false

Computer Science & Information Technology

In the box trace, each box contains all of the following EXCEPT ______.

a) the values of the references and primitive types of the method’s arguments b) the method’s local variables c) the method’s class variables d) a placeholder for the value returned by each recursive call from the current box e) the value of the method itself

Computer Science & Information Technology