type

SocketOptions

src class SocketOptions : Obj

SocketOptions groups together all the socket options used to tune a TcpSocket, TcpListener, or UdpSocket. See the options method of each of those classes for which options apply. Accessing an unsupported option for a particular socket type will throw UnsupportedErr.

fields

broadcast

SO_BROADCAST socket option.

connectTimeout

Controls default timeout used by TcpSocket.connect.

inBufferSize

The size in bytes for the sys::InStream buffer.

keepAlive

SO_KEEPALIVE socket option.

linger

SO_LINGER socket option controls the linger time or set to null to disable linger.

noDelay

TCP_NODELAY socket option specifies that send not be delayed to merge packets (Nagle's algorthm).

outBufferSize

The size in bytes for the sys::OutStream buffer.

receiveBufferSize

SO_RCVBUF option for the size in bytes of the IP stack buffers.

receiveTimeout

SO_TIMEOUT socket option controls the amount of time this socket will block on a read call before throwing an IOErr timeout exception.

reuseAddr

SO_REUSEADDR socket option is used to control the time wait state of a closed socket.

sendBufferSize

SO_SNDBUF option for the size in bytes of the IP stack buffers.

trafficClass

The type-of-class byte in the IP packet header.

methods

copyFrom

Set all of this instance's options from the specified options.

Slot Details

broadcast

src Bool broadcast

SO_BROADCAST socket option.

connectTimeout

src @Deprecated { msg="Use SocketConfig.connectTimeout" }
Duration? connectTimeout

Controls default timeout used by TcpSocket.connect. A null value indicates a system default timeout.

copyFrom

src Void copyFrom(SocketOptions options)

Set all of this instance's options from the specified options.

inBufferSize

src Int? inBufferSize

The size in bytes for the sys::InStream buffer. A value of 0 or null disables input stream buffing. This field may only be set before the socket is connected otherwise Err is thrown.

keepAlive

src Bool keepAlive

SO_KEEPALIVE socket option.

linger

src Duration? linger

SO_LINGER socket option controls the linger time or set to null to disable linger.

noDelay

src Bool noDelay

TCP_NODELAY socket option specifies that send not be delayed to merge packets (Nagle's algorthm).

outBufferSize

src Int? outBufferSize

The size in bytes for the sys::OutStream buffer. A value of 0 or null disables output stream buffing. This field may only be set before the socket is connected otherwise Err is thrown.

receiveBufferSize

src Int receiveBufferSize

SO_RCVBUF option for the size in bytes of the IP stack buffers.

receiveTimeout

src Duration? receiveTimeout

SO_TIMEOUT socket option controls the amount of time this socket will block on a read call before throwing an IOErr timeout exception. Null is used to indicate an infinite timeout.

reuseAddr

src Bool reuseAddr

SO_REUSEADDR socket option is used to control the time wait state of a closed socket.

sendBufferSize

src Int sendBufferSize

SO_SNDBUF option for the size in bytes of the IP stack buffers.

trafficClass

src Int trafficClass

The type-of-class byte in the IP packet header.

For IPv4 this value is detailed in RFC 1349 as the following bitset:

  • IPTOS_LOWCOST (0x02)
  • IPTOS_RELIABILITY (0x04)
  • IPTOS_THROUGHPUT (0x08)
  • IPTOS_LOWDELAY (0x10)

For IPv6 this is the value placed into the sin6_flowinfo header field.