The error says "Socket closed" this means that the connection between your Agent machine and DB has been closed.
Could you please do a telnet to the DB host and Port from agent machine and see if that succeeds.
check if the firewalls and network settings are done in a way that the communication can be established between two hosts.
Please also check this KB article, it might help with the troubleshooting.
the "socket closed" error does not bear much information on the cause and I encourage you investigate with your network team as well.
Thanks to all for your suggestions