DatagramSocket allows a server to accept UDP packets, whereas ServerSocket allows an application to accept TCP connections. It depends on the protocol we\'re trying to implement. If we\'re creating a new protocol.
DatagramSockets communicate using UDP packets. These packets don\'t guarantee delivery - we\'ll need to handle missing packets in our client/server.
ServerSockets communicate using TCP connections. TCP guarantees delivery, so all we need to do is have our applications read and write using a socket\'s InputStream and OutputStream.