O'Reilly logo

Distributed Computing in Java 9 by Raja Malleswara Rao Pattamsetti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Socket programming for UDP

Java supports both TCP and UDP through the Socket and DatagramSocket classes from the java.net package. Other components of this package foster communication between processes over the network using an IP address. A new socket object can be instantiated through the socket name or InetAddress and the port on which the process is running on the host.

As seen earlier, TCP is considered consistent in terms of receiving data in packets the same order as they are sent and with guaranteed delivery. If the next packet is not received in a defined period of time, then the receiver requests it again. The receiver keeps waiting until the packet is received and doesn't move further. In the UDP protocol, it's the other way round: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required