I'm relatively new to networking, and trying to fix some TNet code that is preexisting in our project is causing me trouble. I know what I want to be done, I'm just not sure how to go about coding it. Sorry if this is obvious/ has been posted before, but I searched pretty thoroughly.
We have an application that is creating a local server, and another application for devices to connect to that server over a network with no internet access. Currently, only one server can exist, but I'd like for multiple servers to be supported. Lobbying seems to be the best way to do this, but there won't be a persistent host for the lobby.
My first question is thus;
- Computer A begins a lobby, then a server, and connects to it
- Computer B begins a second server, registers it to the lobby, and connects it
- Computer A is done using the application, and shuts down
- Computer C wishes to connect to a server
When Computer C wishes to connect, will it have access to the lobby listing Computer B's server, or was that lobby destroyed with Computer A? In other words, can you define the lobby dynamically based on servers that exist? Can Computer A transfer the lobby to Computer B?
I'm assuming no. In that case, my second question is thus; How can one generate a list of locally hosted servers WITHOUT a lobby? Is there any way to do this automatically without manually typing in the address? Would defining a range of ports to check for servers work? Can I just send pings? Through what methods could I automate this?