reconnect if connection to mysql is lost
some comments
removed unneded mutex and ipv6 handler