Something I learned today: If you offer an service in your application and you announce it on the network using Bonjour, you can pass a port number. But you don't need to ask the user for a port number or hard code one. You can simply let the operation system pick a port for you:
ServerSocket1.Port = 0
So you specified 0, you started the socket and now you can read what port you got. If you announce this port now on Bonjour using our DNSServiceRegisterMBS class, your clients will easily find you.