klyn.net.ServerSocket.localPort
property
public readonly property localPort as Int:
Description

Local listening port, including the actual port selected for a 0 bind.

try server = ServerSocket(0):
assert server.localPort > 0