Network Programming: The Network Socket

The basic TCP/IP network programming facility is the network socket. The network socket represents a communication point between two programs. Programs use the sockets for input, output, or both. The socket is identified by a begin point (an IP address) and an endpoint (an IP address and a port number) such that multiple connections can be made to the same server on the same port, as shown in Figure 17-3.

Figure 17-3. TCP/IP sockets.

Java provides an API that allows the creation of sockets over TCP/IP networks. This API is integrated with the streams API to provide a clean abstraction of I/O. An application ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.