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
  • SocketException if the operating system cannot create a TCP socket.
  • IOException if binding or listening fails.
Example
server = ServerSocket(0)
assert server.localPort > 0
server.close()