Describe and observe the outcome.

This exercise guides you through experiments with connection-oriented datagram socket using code sample Example4

Compile and run Example4*.java. Start the Acceptor first, then the Requestor. Sample commands to do so are:
```
Java Example4ConnectionAcceptor 12345 Good-day!
Java Example4ConnectionRequestor localhost 12345
```


A script of the runs is as below:
C:\tmp>Java Example4ConnectionAcceptor 12345 Good-day!
now ready accept a connection
connection accepted
message sent
data socket closed
connection socket closed

C:\tmp>Java Example4ConnectionRequestor localhost 12345
Connection request granted
waiting to read
Message received:
Good-day!
data socket closed

The acceptor blocked waiting for a connection request, until the requestor is started and issues such a request. At that point the accept method call in the requestor is unblocked and the string (“Good-day!”) is sent by the acceptor to the requestor. The acceptor promptly closes the socket on its end. Meanwhile, the requestor echoes the message that it receives before it too closes the socket on its end.

Computer Science & Information Technology

You might also like to view...

Extend the form letter recipe to take an input of a pet's name and type, and reference the pet in the form letter. "Your pet "+petType+","+petName+" will love our offer!" might generate "Your pet poodle, Fifi, will love our offer!". See the FormLetterGenerator class in the directory bookClassesFinal.

What will be an ideal response?

Computer Science & Information Technology

A ________ is used to display data on the main form on different tabs

A) display control B) tab control C) form control D) property

Computer Science & Information Technology

Power is measured in _____

Fill in the blank(s) with correct word

Computer Science & Information Technology

To insert slides from another presentation into a current presentation, click the New Slide list arrow in the Slides group, then click Insert Slides. _________________________

Answer the following statement true (T) or false (F)

Computer Science & Information Technology