# SocketOption

`import { SocketOption } from "destack:net/binding";`

Socket option key.

```ds title="SocketOption"
export enum SocketOption {
    ReuseAddress = 1,
    ReusePort = 2,
    Broadcast = 3,
    ReceiveBufferBytes = 4,
    SendBufferBytes = 5,
    ReceiveTimeoutMilliseconds = 6,
    SendTimeoutMilliseconds = 7,
    Linger = 8,
    Ttl = 9,
    TrafficClass = 10,
    Ipv6Only = 11,
    TcpNoDelay = 12,
    TcpKeepAlive = 13,
    PacketMark = 14,
    PacketTimestamp = 15,
}
```

[language/library/src/net/binding/options.ds:35:66](https://github.com/destack-sh/destack/blob/main/language/library/src/net/binding/options.ds#L35-L66)

## Variants

### `ReuseAddress = 1`

Reuse local addresses.

### `ReusePort = 2`

Reuse local ports.

### `Broadcast = 3`

Allow broadcast packets.

### `ReceiveBufferBytes = 4`

Receive buffer size in bytes.

### `SendBufferBytes = 5`

Send buffer size in bytes.

### `ReceiveTimeoutMilliseconds = 6`

Receive timeout in milliseconds.

### `SendTimeoutMilliseconds = 7`

Send timeout in milliseconds.

### `Linger = 8`

Linger settings.

### `Ttl = 9`

IPv4 time-to-live or IPv6 hop limit.

### `TrafficClass = 10`

Traffic class or type-of-service value.

### `Ipv6Only = 11`

Whether IPv6 sockets accept only IPv6 traffic.

### `TcpNoDelay = 12`

Disable Nagle's algorithm.

### `TcpKeepAlive = 13`

TCP keepalive settings.

### `PacketMark = 14`

Packet mark value.

### `PacketTimestamp = 15`

Packet timestamping mode.
