Prevent socket connection time out when firewall enabled

I am running Comodo Firewall 8.0.0.4337 in Windows 8.1 and a Linux virtual machine via VirtualBox.

In Windows I have a Java socket server application. In the virtual machine, there is a Java socket client application.

If the socket server is not running and the socket client tries to connect, I get a “Connection time out” error. But if I disable Comodo Firewall, I get a “Connection refused” error instead.

If the socket server is enabled, the socket client connects without problems (firewall enabled).

What I would like to know is how I can’t prevent the socket to get a “connection time out” when the firewall is enabled. I tried opening the connection port in global rules but there was no difference.

Thanks.