socket.address()


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

如果在未绑定的套接字上调用此方法将抛出 EBADF

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.