socket.remoteAddress()


返回一个包含远程端点的 addressfamilyport 的对象。如果套接字未连接,此方法会抛出 ERR_SOCKET_DGRAM_NOT_CONNECTED 异常。

【Returns an object containing the address, family, and port of the remote endpoint. This method throws an ERR_SOCKET_DGRAM_NOT_CONNECTED exception if the socket is not connected.】