Results 1 to 1 of 1
Thread: Socket question
- 03-10-2010, 04:12 AM #1Member
- Join Date
- Jan 2010
- Rep Power
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):
kkSocket = new Socket("KIM-PC", 62571);
Since both computers share the same IP Address, can I use the Socket class as follows?
Socket(String host, int port, InetAddress localAddr, int localPort)
Socket("KIM-PC", 62571, xxx.xxx.xxx.xxx, int localPort)
If so, what is the localPort?
- By orchid in forum Advanced JavaReplies: 9Last Post: 12-19-2010, 09:49 AM
- By email@example.com in forum NetworkingReplies: 3Last Post: 04-17-2009, 07:02 PM
- By rob in forum New To JavaReplies: 1Last Post: 03-19-2009, 03:24 PM
- By paul in forum NetworkingReplies: 1Last Post: 07-30-2007, 07:26 PM
- By Heather in forum XMLReplies: 2Last Post: 07-04-2007, 09:31 AM