socket.address()


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

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

如果在未绑定的套接字上调用此方法,会抛出 EBADF 异常。

🌐 This method throws EBADF if called on an unbound socket.