public ServerSocket(port as Int) throws IOException
Creates a listening TCP socket.
A port of 0 asks the operating system to select an available ephemeral port. The assigned value is then available through localPort.
import klyn.net
try server = ServerSocket(0):
print(server.localPort)| Parameter | Description |
|---|---|
port | Requested TCP port, or 0 for an automatically assigned port. |