Sounds like a firewall issue.
If you're using Windows 7, type in "firewall" to the Start -menu's Search box, and you should come across something called Advanced Windows Firewall.
From there, check that GTA IV or IV:MP related *.exe's aren't being blocked and if they are not on the list, add them there (both inbound & outbound connections) and allow them to access.