socket() creates an endpoint for communication and returns a descriptor.
bind
bind() gives the socket sockfd the local address my_addr. It is normally necessary to assign a local address using bind() before a SOCK_STREAM socket may receive connections.
listen
To accept connections, a socket is first created with socket (), a willingness to accept incoming connections and a queue limit for incoming connections are specified with listen(), and then the connections are accepted with accept. The listen() call applies only to sockets of type SOCK_STREAM or SOCK_SEQPACKET.
accept
The accept() system call is used with connection-based socket types (SOCK_STREAM, SOCK_SEQPACKET). It extracts the first connection request on the queue of pending connections, creates a new connected socket, and returns a new file descriptor referring to that socket.
connect
The connect() system call connects the socket referred to by the file descriptor sockfd to the address specified by serv_addr.