WallShadow wrote:Hello,
I recently learned basic Java socket programming and successfully tested it on my local network with 2 computers (thanks to whomever posted the good HTTP tutorial). I was able to use the ipconfig command to get my computer's local IP address and used that to connect the sockets on the 2 computers. But I wanted to ask, how can I connect to a remote network, for example, my friend's network?
thanks for reading.
How can you connect to the network? Or connect to the computer?
--I will tell you now that I rarely ever, to never program with Internet related items. This is all just what I believe will work, and verification is needed.--
Computer:
Server -You would need a server program on that computer that would wait for all connections to a certain port, and accept them. You would then place whatever you want to happen once connection is made after that.
Client - You would also need a client program that attempts to use the provided I.P address (you'll need to get your friends, computers I.P address) and port number, to connect to that port.
Network:
Server - The only difference here is that you _could_ possibly use your friends computer to get access to his LAN, and use it that way. Though it would be tricky. Or, you could go sit outside his house with a laptop.