|
Distributed Computing ![]() This website demonstrates using wikis as teaching and learning tool. The course instructor is also happy to share the teaching materials here with those who find it readable. |
Suggested Answers to TutorialTutorial : Daytime Client and Server (UDP) Questions and Answers
The four methods are: getAddress, getData, getLength, and getPort.
The four methods are: setAddress, setData, setLength, and setPort.
Exception of type SocketException.
It is used to specify the number of milliseconds that the receive() method waits to receive a UDP packet, after which it aborts with an InterruptedIOException.
The three methods are: setReceiveBufferSize, setSendBufferSize, and setSoTimeout.
The five methods are: getLocalAddress, getLocalPort, getReceiveBufferSize, getSendBufferSize, and getSoTimeout.
The operating system assigns an unused port to the DatagramSocket.
Yes.
No. You must specify a port number known to other people so that they can send packets to you.
Set the length of the DatagramPacket object to be 65508, which is the maximum size of any UDP packet.
Step 3: the method receive() of DatagramSocket blocks until it has successfully received a packet or a timeout occurs.
Normally, you should change the data payload and the payload length of your created DatagramPacket object, using the methods setData and setLength of DatagramPacket.
|