bind_ports returns the port used.