There are two ends to each connection: the client, that is the host that initiates the connection, and the server, that is the host that responds to the connection.
Clients and servers are connected by sockets.
A server, rather than connecting to a remote host, a program waits for other hosts to connect to it.