# SetSockOption

## Description

Sets any of the various options for the socket identified by the specified socket handle. Note that not all options are supported by every stack.

## Remarks

The following is a list of options that are available for this methd, and their meanings.

<table><thead><tr><th width="154">Option</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>SSQ_SO_DEBUG</td><td>Boolean</td><td>Records debugging information</td></tr><tr><td>SSQ_SO_REUSEADDR</td><td>Boolean</td><td>Sets whether Winsock should reuse sockets</td></tr><tr><td>SSQ_SO_KEEPALIVE</td><td>Boolean</td><td>Set whether Winsock should send keep-alives</td></tr><tr><td>SSQ_SO_DONTROUTE</td><td>Boolean</td><td>Set whether Winsock should route or send directly to interface</td></tr><tr><td>SSQ_SO_BROADCAST</td><td>Boolean</td><td>Set whether to allow broadcast messages</td></tr><tr><td>SSQ_SO_USELOOPBACK</td><td>Boolean</td><td>Bypass hardware where possible</td></tr><tr><td>SSQ_SO_LINGER</td><td>Integer</td><td>Indicates if the socket should linger when closing and for how long</td></tr><tr><td>SSQ_SO_OOBINLINE</td><td>Boolean</td><td>Indicates whether to receive OOB data in the normal data stream</td></tr><tr><td>SSQ_TCP_NODELAY</td><td>Boolean</td><td>Specifies whether to disable the Nagle algorithm for send coalescing</td></tr><tr><td>SSQ_OPTIONAL_SO_SNDBUF</td><td>Integer</td><td>Specifies the total per-socket buffer space for sends</td></tr><tr><td>SSQ_OPTIONAL_SO_RCVBUF</td><td>Boolean</td><td>Specifies the total per-socket buffer space for receives</td></tr><tr><td>SSQ_OPTIONAL_SO_SNDLOWAT</td><td>Integer</td><td>Send low-water mark</td></tr><tr><td>SSQ_OPTIONAL_SO_RCVLOWAT</td><td>Integer</td><td>Receive low-water mark</td></tr></tbody></table>

## Prototype

LONG CSockQ::SetSockOption(long SocketHandle, SQ\_SOCK\_OPTION SockOption, LONG NewOptValue)
