Using socket classes

Socket classes allow you to do more sophisticated network transfers than you can achieve using URL classes. The Socket class allows you to connect to specified port on any specified network host, and use the InputStream and OutputStream classes to read and write the data.