---
id: udp-open
name: Udp.open
category: udp
kind: namespace-method
tokens: Udp.open
sig: Udp.open(port) -> int
tip: Open a socket on a port.
order: 0
ns: Udp
member: open
---
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.
```ludic
program Demo {
entry {
let s = Udp.open(port: 0)
print(s > 0)
}
}
```