# tensorplay.distributed.elastic.utils.get_socket_with_port Source: https://www.tensorplay.cn/docs/generated/tensorplay.distributed.elastic.utils.get_socket_with_port.html ```python tensorplay.distributed.elastic.utils.get_socket_with_port() → socket ``` Create a socket bound to an ephemeral local port and return it. The caller owns the socket; close it once the port has been consumed.