what is the purpose of sockets in programming
A network socket is one endpoint in a communication flow between two programs running over a network. Sockets are created and used with a set of programming requests or function calls sometimes called the sockets application programming interface (API). The most common sockets API is the Berkeley UNIX C interface for sockets. Sockets can also be used for communication between processes within the same computer. This is the typical sequence of sockets requests from a server application in the connectionless context of the Internet in which a server handles many client requests and does not maintain a connection longer than the serving of the immediate request: