klyn.net.ServerSocket.bind
method
public bind(port as Int, backlog as Int, host as String) as Void throws IOException:
Description

Binds and starts listening.

Parameters
ParameterDescription
portRequested TCP port, or 0 for an automatically assigned port.
backlogMaximum pending connection queue length.
hostLocal IPv4 host or wildcard address.
Throws
  • IOException if the socket stream is closed, disconnected, times out, or the underlying network I/O fails.
Example
server = ServerSocket(0)
assert server.localPort > 0
server.close()