Cannot get BITCOIND RPC connection working on Ubuntu 12.04 or Windows 7
Netstat(1) will give you open ports (in this case listening TCP ports): netstat -lnt.

To make sure you know which port your bitcoind daemon is using, start it with paramter -rpcport. In your example, use exactly -rpcport=8332, then use the same port when connecting to it.