This socket class is a C++ programming interface for using sockets. The current implementation uses stream sockets of the INET type. Modification to support datagram sockets and sockets of other types is left to the reader.

Member functions:

For both client and server Only for a server (passive socket) Only for a client (active socket)
To enable finding a socket in the network we need a socket address. This is formed by the IP address (or host name) of the computer and a port number. A listening socket gets a port address with the bind() call. An active socket that wants to connect to a listening socket uses that socket's IP address or host name and its port number in the connect() call.

C++ Source: