Application work fine on localhost .but when its connect to server it getting error.
I connect server through port 22
This is the error
Error:
If you are only reaching this error after many requests, you might want to check your port range settings and adjust them. There is also TCP timeout settings, such as FIN_WAIT that can keep connections open for longer than expected.
sysctl -a | grep net should show all network connection settings.
sysctl -a | grep port for port range settings.
sysctl -a | grep keep for tcp wait settings.
See here and here(mac here) for a little more detail/advice on what the settings are.
If you are going to modify settings, I would suggest that you first copy /etc/sysctl.conf to something like /etc/sysctl.conf.bak and then modify the setting in that file. They can be adjusted via the command-line but that is temporary and resetting them can be a mess.
You probably don't want to do this in production.
Additional docs:
https://ma.ttias.be/linux-increase-ip_local_port_range-tcp-port-range/
https://easyengine.io/tutorials/linux/sysctl-conf/