Socket descriptors get recycled on a per process base.
accept()
gives you an sd, then you fork-off the client and close the sd in the parent and start over. As the sd had been closed it very well may get used again by the next successful call to accept()
.
As you fork-off a new process for each client, the process-id might be a way to identify a client, at least as long as it is connected and its process is existing.
To historise the connections this (the pid only) may not work as process-ids also might be recycled. So for this case you need to invent some really unique connection id, for example by combining the pid with the timestamp it was created at.