bitflag enum io.SocketOptions

Overview

This enum lists all possible IO flags applicable to io.Socket class. More…

bitflag enum SocketOptions: io.StreamOptions {
    ReuseAddress,
    TcpKeepAlive,
    TcpNagle,
    TcpReset,
    UdpBroadcast,
    RawHdrIncluded,
};

Detailed Documentation

This enum lists all possible IO flags applicable to io.Socket class.

Enum Values

ReuseAddress

Allow forcibly binding multiple sockets to the same local address (unless there’s an active listening a socket already bound to the same address). Internally maps to SO_REUSEADDR socket option.

TcpKeepAlive

Translates to SO_KEEPALIVE socket option.

TcpNagle

This option is used for turning the Nagle algorithm ON or OFF for TCP sockets. When this property is set to true, the socket attempts to delay the transmission of TCP data segments in order to reduce the overall number of transmitted packets.

For detailed description of Nagle algorithm refer to: http://en.wikipedia.org/wiki/Nagle’s_algorithm

TcpReset

This option is used for setting the disconnect type for TCP sockets – whether it should be graceful (via FIN sequence) or reset (via RST packet).

UdpBroadcast

This option is used for allowing the broadcast transmission over datagram-oriented protocols(such as UDP). When this option is set, the socket is allowed to send broadcast packets into the network.

RawHdrIncluded

This option is used for setting the IP_HDRINCL flag for RAW sockets. When this property is set to true, the application must provide IP header together with the rest of the packet(however, the kernel may still overwrite certain fields, such as checksum).

For detailed description of raw sockets refer to: http://man7.org/linux/man-pages/man7/raw.7.html