Udp.open/port/send/recv/from_ip/from_port/close/resolve/local_ip/ip/ip_text, native BSD sockets (udp.ll) and Winsock (udp_win.ll, -lws2_32), linked only when a program uses Udp.*; example, docs and tests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
525 B
525 B
| id | name | category | kind | tokens | sig | tip | order | ns | member |
|---|---|---|---|---|---|---|---|---|---|
| udp-open | Udp.open | udp | namespace-method | Udp.open | Udp.open(port) -> int | Open a socket on a port. | 0 | Udp | 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.
program Demo {
entry {
let s = Udp.open(port: 0)
print(s > 0)
}
}