API Reference / api/util/SocketAddress / SocketAddress
Class: SocketAddress
Defined in: api/util/SocketAddress.d.ts:6
表示一个IP套接字地址(主机名和端口号)。
Constructors
new SocketAddress()
ts
new SocketAddress(hostname, port): SocketAddress
Defined in: api/util/SocketAddress.d.ts:7
Parameters
hostname
string
port
number
Returns
Methods
getHostname()
ts
getHostname(): string
Defined in: api/util/SocketAddress.d.ts:16
获取此套接字地址的主机名。
Returns
string
该套接字地址的主机名
getPort()
ts
getPort(): number
Defined in: api/util/SocketAddress.d.ts:23
获取此套接字地址的端口号。
Returns
number
该套接字地址的端口号
toString()
ts
toString(): string
Defined in: api/util/SocketAddress.d.ts:9
Returns
string