Previous | Next | Trail Map | Custom Networking and Security | Table of Contents


All about Sockets

[PENDING: intro material here, talk some about client/server model. draw a picture]

What is a Socket?

A socket is one end of a two-way communications link between two programs running on the network. Sockets are used to implement the connection between a client program and a server program. The java.net package provides two classes--Socket and ServerSocket--that implement the client side of the connection and the server side of the connection, respectively.

Reading from and Writing to a Socket

This page contains a small example that illustrates how a client program can read from and write to a socket.

Writing the Server Side of a Socket

The previous page showed an example of how to write a client program that interacted with an existing server via a Socket object. This page will show you how to write a program that implements the other side of the connection--a server program.

Advanced Sockets

[PENDING: This section could cover: providing your own socket implementation (covers Socket.setSocketImplFactory(), ServerSocket.setSocketFactory(), the SocketImplFactory interface, and the SocketImpl class)]

The InetAddress Class

[PENDING: this section would talk about the InetAddress class and the getInetAddress() methods.]


Previous | Next | Trail Map | Custom Networking and Security | Table of Contents