I have 2 computers on a local network with a router. I installed NetBeans and JDK on both computers and successfully ran the Client/Server KnockKnock tutorial, which uses the socket class.

My client (MyCPU) uses the following line to create a new Socket object to connect to the server (Kim-PC):

Java Code:
kkSocket = new Socket("KIM-PC", 62571);
I want to try to get it working across the internet now instead of just on my local network.

Since both computers share the same IP Address, can I use the Socket class as follows?

Java Code:
Socket(String host, int port, InetAddress localAddr, int localPort)
which would translate on my system to...
Java Code:
Socket("KIM-PC", 62571, xxx.xxx.xxx.xxx, int localPort)
*where xxx.xxx.xxx.xxx = my IP address

If so, what is the localPort?