API Reference › Udp › Udp.open
method

Udp.open

Udp.open(port) -> int

Opens a non-blocking IPv4 socket bound to port on every interface and returns its handle, or 0 when it could not. Port 0 lets the system pick a free one; Udp.port says which.

Example

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