The java.net.Socket
class allows you to create socket objects that perform all four fundamental
socket operations.
You can connect to remote machines; you can send data; you can receive data; you can close the connection.
Each Socket
object is associated with exactly one remote host. To connect to a different
host, you must create a new Socket
object.