I would like to program a game that can be played by several players sitting in front of another computer who are connected through a network, and I want to use Java for this. In this regard, I have a few questions. I will be glad if you answer at least one question.
I can imagine two different situations. In the first, I create a local area network between computers. In the second case, I use the Internet as a medium for communication between computers. So, my first question is: if the two above cases require different approaches (from a software point of view).
The second question is how computers can identify each other. For example, two computers are connected to the Internet, and, theoretically, they can see each other. But how does the first computer know how to refer to the second? Maybe computers should know each other's IP addresses? But what if the IP addresses are dynamic? Every time the IP address changes, will the connection be lost?
If I use a local area network, is it possible for each computer to see everything on the network?
Say my computer knows the address of another computer. What can he do with it? Can I send a file to this computer? How does the second computer know that something has been sent to it? How does the second computer know what to do with the file? Should I run on a second computer a program that constantly checks that something has arrived, and if something has arrived (file), the program must know what to do with it.
Roman source
share