In order to fix the connectivity error, go to Start > Control Panel > System and Security > Windows Firewall > Allow a program through Windows firewall and click the Allow another program button. Use the Browse option to navigate to the Pokemon Online installation directory, select its executable file and press Add.
After that, make sure that the ports are not blocked. Go to Windows firewall, press Advanced Settings and select Inbound Rules. Click New Rule from the right, check the Port box, click Next, select All local ports and then Next again. Check the Allow the connection box, press Next twice and follow the instructions.
Also, set your security program firewall to allow the Pokemon Online connection. If the problem is not solved, download and install the latest version of the client.