Add getRemotePort function in Connection.php.