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.