First, what exactly Bonjour does (please read my guesses written below)?
Here I found out that Bonjour enables the automatic discovery of computers, devices, and services on IP networks. But I thought that it not only "discovers devices on IP network" it also creates an IP network by assigning IP addresses to devices where Bonjour is running. Am I right?And I still miss the essence. Does it work in the following way? First I connect devices (for example laptops) physically so that they potentially can communicate with each other. Then, let's say, on some laptops I have Bonjour running, and then, as a consequence, these laptops assign IP addresses to them self automatically. So, laptops (where Bonjour is running) build an IP network. Does it work this way?
Or maybe a computer running Bonjour is not considered a service and it does not broadcast itself just because Bonjour is running on this computer. I mean that the applications running on the computers need to use Bonjour to broadcast themself. So, it is applications that broadcast themself (not computers) and it is not done automatically (application needs to broadcast themself explicitly). Is it right?
How exactly my application can broadcast itself? Can I use the command line to register a service (so that all applications using Bonjour know that a new service appeared)?
Further, I would like to have an application that uses the IP network created by Bonjour. For that, my application needs to know which devices/services are present in the network. In more detail, my application needs to have a list of services. Each service in the list should have a name, the IP address where it is running, and the port which is used by the application. Can Bonjour provide this information in some way? If it is the case, how exactly it works? How my program can get this information from Bonjour? Can my program read some files created by Bonjour containing the above-mentioned information? Can I use some commands in the command line to retrieve this information?
I have a special interest in accessing information about services from files, environment variables, or commands in the command line. These options seem to me to be the simplest! Since in these case, I do not need to use any additional libraries to communicate with Bonjour from a particular programming language.
P.S. Please ask questions if something is not clear in my question. I will try to formulate my question in a more clear way.
P.P.S. I use Windows 7.
ADDED: I plan to write my applications in PHP. Every computer should run an Apache web server. And I want to use Bonjour to help computers discover each other (computers are working in a local network).