Socket & Address Class

Socket Class library defines a family of C++ classes that can be used more effectively than directly calling the underlying low­level system functions.
One distinct advantage of the socket library is that it has the same interface as that of the iostream. socket is an endpoint for communication with yet another socket or simply a socket descriptor. socket has also methods that act as interfaces for most of the commonly used system calls that involve sockets.
For each communication domain, we derive a new class from socket that has some additional methods that are specific to that domain. sockunix class and sockinet class define the unix and inet domain of sockets respectively.
We also have domain specific socket address classes that are derived from a common base class called sockAddr. sockunixaddr class is used for unix domain addresses and sockinetaddr class is used for inet domain addresses.