| 1 |
// SPDX-License-Identifier: MPL-2.0 |
| 2 |
// (c) Hare authors <https://harelang.org> |
| 3 |
|
| 4 |
use net; |
| 5 |
|
| 6 |
// Enables port re-use for a UDP listener. |
| 7 |
export type reuseport = void; |
| 8 |
|
| 9 |
// Enables address re-use for a UDP listener. |
| 10 |
export type reuseaddr = void; |
| 11 |
|
| 12 |
// To have the system select an arbitrary unused port for [[listen]], set port to |
| 13 |
// zero. To retrieve the assigned port, provide this as one of the options and |
| 14 |
// the addressed u16 will be filled in with the port. |
| 15 |
export type portassignment = *u16; |
| 16 |
|
| 17 |
// Options for [[connect]]. |
| 18 |
export type connect_option = net::sockflag; |
| 19 |
|
| 20 |
// Options available for [[listen]]. |
| 21 |
export type listen_option = ( |
| 22 |
reuseport | |
| 23 |
reuseaddr | |
| 24 |
portassignment | |
| 25 |
net::sockflag); |
| 26 |
|
| 27 |
// TODO: Add send/recv flags |