I don't think we can know the port number up front, as there may be many AMs running on the same host, thereby forcing us onto a different port. @beysims can maybe shed some light on conventions around this.