Java Authenticator getRequestingPort() 方法

2025 年 3 月 20 日 | 阅读 2 分钟

Authenticator 类的 getRequestingPort() 方法用于获取请求连接的端口号。

语法

参数

不传递任何参数。

返回

指示请求连接端口的整数。

Throw

不抛出异常

示例 1

输出

Host using url.getHost ::www.TpointTech.com
Port Requesting :8080
//source code of https://tpointtech.cn is printed

示例 2

输出

Portname:8080
//source code of https://tpointtech.cn is printed.