A RegistrationListener for the services.
Finds an available port for the server socket.
Returns the IP address based on whether the app is running on an emulator or not.