| 1 |
// SPDX-License-Identifier: MPL-2.0 |
| 2 |
// (c) Hare authors <https://harelang.org> |
| 3 |
|
| 4 |
use net; |
| 5 |
|
| 6 |
// Enables keep-alive for a socket. |
| 7 |
export type keepalive = void; |
| 8 |
|
| 9 |
// Configures the backlog size for a listener. If not specified, a sensible |
| 10 |
// default (10) is used. |
| 11 |
export type backlog = u32; |
| 12 |
|
| 13 |
// Enables port re-use for a TCP listener. |
| 14 |
export type reuseport = void; |
| 15 |
|
| 16 |
// Enables address re-use for a TCP listener. |
| 17 |
export type reuseaddr = void; |
| 18 |
|
| 19 |
// To have the system select an arbitrary unused port for [[listen]], set port to |
| 20 |
// zero. To retrieve the assigned port, provide this as one of the options and |
| 21 |
// the addressed u16 will be filled in with the port. |
| 22 |
export type portassignment = *u16; |
| 23 |
|
| 24 |
// Options for [[connect]]. |
| 25 |
export type connect_option = (keepalive | net::sockflag); |
| 26 |
|
| 27 |
// Options for [[listen]]. |
| 28 |
export type listen_option = ( |
| 29 |
keepalive | |
| 30 |
reuseport | |
| 31 |
reuseaddr | |
| 32 |
backlog | |
| 33 |
portassignment | |
| 34 |
net::sockflag); |