Multiple places are available where Linux puts a limit on the number of file descriptors we are allowed to open.
Check out the following:
cat /proc/sys/fs/file-max
It will show you the system-wide limits of file descriptors.
On the shell level, the personal limit is displayed:
ulimit -n
We can change it /etc/security/limits.conf - it's the nofile param.
But, if you try to close your sockets correctly, you will not receive this unless simultaneous connections are being opened.