- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
A socket is a software endpoint that establishes bidirectional communication between a server
program and one or more client programs. The socket associates the server program with a
specific hardware port on the machine where it runs so any client program anywhere in the
network with a socket associated with that same port can communicate with the server program.
A server program typically provides resources to a network of client programs.
Client programs send requests to the server program, and the server program responds
to the request.
One way to handle requests from more than one client is to make the server program
multi-threaded.
A multi-threaded server creates a thread for each communication it accepts from a client.
A thread is a sequence of instructions that run independently of the program and of any
other threads.
Using threads, a multi-threaded server program can accept a connection from a client, start a thread for
that communication, and continue listening for requests from other clients.
***
|