H
Hans Kamp
I found a useful client/server combination for newbies at
http://www.msdnaa.net/Resources/Display.aspx?ResID=1375
I typed both of the programs and I ran them on one of my 2 computers (I have
a desktop and a laptop PC).
Then I copied the client program to the laptop, connected the laptop to my
PC, and I changed the following line:
TcpClient tcpClient = new TcpClient ("localhost", 4444);
to:
TcpClient tcpClient = new TcpClient(myIP, 4444);
(in which myIP is the IP address of my computer, that is displayed if you
typed "ipconfig" at the command prompt).
This all worked fine! I had to disconnect my computer from the Internet
(since I have a cable modem).
Now my question. Imagine the following situation:
- A friend of mine runs the server side program on his computer and gives me
his IP address;
- Both he and I connect our computers to the Internet (both he and I have
cable modems);
- I change the above statement (in the cliend side program) to:
TcpClient tcpClient = new TcpClient(MyFriendsIP, 4444);
- I run the client side program.
Will the communication still work?
I am still a network newbie but my first few steps were successful.
Will this also work with a router and two computers connected to it?
Hans Kamp.
http://www.msdnaa.net/Resources/Display.aspx?ResID=1375
I typed both of the programs and I ran them on one of my 2 computers (I have
a desktop and a laptop PC).
Then I copied the client program to the laptop, connected the laptop to my
PC, and I changed the following line:
TcpClient tcpClient = new TcpClient ("localhost", 4444);
to:
TcpClient tcpClient = new TcpClient(myIP, 4444);
(in which myIP is the IP address of my computer, that is displayed if you
typed "ipconfig" at the command prompt).
This all worked fine! I had to disconnect my computer from the Internet
(since I have a cable modem).
Now my question. Imagine the following situation:
- A friend of mine runs the server side program on his computer and gives me
his IP address;
- Both he and I connect our computers to the Internet (both he and I have
cable modems);
- I change the above statement (in the cliend side program) to:
TcpClient tcpClient = new TcpClient(MyFriendsIP, 4444);
- I run the client side program.
Will the communication still work?
I am still a network newbie but my first few steps were successful.
Will this also work with a router and two computers connected to it?
Hans Kamp.