My question is based on the following understanding
- Socket is defined by ip:port. Both server and client will have their own socket
- Socket connection is defined by five touples server_ip, server_port, client_ip, client_port, protocol
- A socket descriptor is an integer value that identifies a socket
I tried to implement my own server where socket() and accept() returns different socket descriptor value (Is it always the case?). My question is why is it said that accept() creates a new socket if no new port is opened in server and ip:port is same for both the socket descriptors returned by socket() and accept(). If new socket is created by accept() how is it different than the socket created by socket()?