new function get_rpc_port to replace pmap_getport