1

I want to implement a game that needs 2 computers to communicate via LAN. I found a lot of topics on how to list all the computers on network, but I could not find how to list all the computers that have my app opened.

I want to make that app so you can create a game and others can join your came (it's a 1v1 game).Inside my program, you can choose to create or to join a game. So when I create my game, my computer will appear as available on network and when I choose to join game, it will list all the computers that are currently waiting for another player.

How could I do such a thing? Or are there other workarounds?

SnuKies
  • 1,578
  • 1
  • 16
  • 37

1 Answers1

0

How the communication is implemented in 1v1 game? A proper solution would be to have your app listening on a specific high port lets say 8765 and then scan the network for this specific port, if its open you can talk to your app behind it and if your request answered you will know its your app.

zochamx
  • 850
  • 8
  • 17
  • That will be my first LAN application, and we should learn about networking now. And do you think firewall will be a big problem? – SnuKies Nov 26 '16 at 22:08
  • 1
    Well it might need to add a firewall rule in order to allow the connection you can check [this question](http://stackoverflow.com/questions/1242566/any-way-to-turn-the-internet-off-in-windows-using-c) about that. – zochamx Nov 27 '16 at 00:19