You are now ready to learn about writing your own socket applications. We begin by demonstrating how Java applications identify network hosts using the
Socket-Address abstractions. Then we present examples of the use of
ServerSocket, through an example client and server that use TCP. Then we do the same thing for the
Datagram-Socket abstraction for clients and servers that use UDP. For each abstraction, we list the most significant methods, grouped according to usage, and briefly describe their behavior.
Recall that a client must specify the IP address of the host running the server program when it initiates communication. The network infrastructure then uses this destination ...