socket.address()


返回一个包含 socket 地址信息的对象。 对于 UDP socket,该对象将包含 addressfamilyport 属性。

This method throws EBADF if called on an unbound socket.

Returns an object containing the address information for a socket. For UDP sockets, this object will contain address, family and port properties.

This method throws EBADF if called on an unbound socket.