API Reference › Udp › Udp.port
method

Udp.port

Udp.port(socket) -> int

Returns the port the socket is bound to - the one the system chose when it was opened on port 0.

Example

program Demo {
  entry {
    let s = Udp.open(port: 0)
    print(Udp.port(socket: s) > 0)
  }
}
← All symbols