Data is sent and received with output and input streams.
There are methods to get an input stream for a socket and an output stream for the socket.
public InputStream getInputStream() throws IOException
public OutputStream getOutputStream() throws IOException
There's also a method to close a socket:
public synchronized void close() throws IOException