In Java, the `Socket` class is used as the **client** socket in a two-way communication with a **server**. Key to this idea is that the socket is *connected* to the server at a ipaddress/host and port. The main constructor you’ll use is
```javascript
Socket(String host, int port);
//Creates a TCP stream socket and connects
//it to the specified port number on the named host.
```
> Note that all `Socket`s in java are TCP (SOCKSTREAM) sockets, if you want to use a different socket type, you’ll need to use one of the other socket classes, like `DatagramSocket`.
Importantly, the `Socket` is to connect to the server, but communication with the server is a two-way procedure. So once we connect to the server, we can *both* read and write to the socket via the socket’s `InputStream` and `OutputStream`. And like with other I/O we can wrap those streams in other buffered readers/writers.