I'm trying to connect to a remote IP address and port using the Winsock control but it stays in the sckConnecting state forever

Code:
Winsock1.RemoteHost = REMOTE_IP_ADDRESS
Winsock1.RemotePort = PORT_NUMBER

Winsock1.Connect

Do While Winsock1.State = 6
DoEvents

Loop
REMOTE_IP_ADDRESS and PORT_NUMBER are constants defined elsewhere


I can ping the ip address ok and if I use an invalid address a different state code is returned.

Any ideas?