Download the platform SDK (Software Developers Kit) from
Microsoft for platform-specific documentation. It is free.
I'd give you the URL but searching http://www.microsoft.com/
requires that JavaScript be turned on and I just don't trust
them enough to do that. q-:
What follows is mostly taken from the setsockopt()
documentation:
- level SOL_SOCKET
- SO_BROADCAST (BOOL) Allow transmission of broadcast messages
- SO_DEBUG (BOOL) Record debugging information
- SO_DONTLINGER (BOOL) Do not block close() waiting for unsent data to be sent. Equivalent to setting SO_LINGER with l_onoff set to zero.
- SO_DONTROUTE (BOOL) Do not route; send directly to the interface.
- SO_GROUP_PRIORITY (int) Reserved for future use with socket groups.
- SO_KEEPALIVE (BOOL) Send keepalives
- SO_LINGER (struct LINGER) Linger on close if unsent data is present.
- SO_OOBINLINE (BOOL) Receive out-of-band data in the normal data stream.
- SO_RCVBUF (int) Specify the total per-socket buffer space reserved for receives. (Unrelated to SO_MAX_MSG_SIZE or the size of a TCP window.)
- SO_REUSEADDR (BOOL) Allow the socket to be bound to an address that is already in use.
- SO_SNDBUF (int) Specify the total per-socket buffer space reserved for sends. (Unrelated to SO_MAX_MSG_SIZE or the size of a TCP window.)
- PVD_CONFIG (Service Provider Dependent) This object stores the configuration information for the service provider associated with socket.
- level IPPROTO_TCP1
- TCP_NODELAY (BOOL) Disables the Nagle algorithm for send coalescing.
- BSD options not supported for setsockopt are:
- SO_ACCEPTCONN (BOOL) Socket is listening
- SO_RCVLOWAT (int) Receive low water mark
- SO_RCVTIMEO (int) Receive time-out (available in Microsoft implementation of Windows Sockets 2)
- SO_SNDLOWAT (int) Send low water mark
- SO_SNDTIMEO (int) Send time-out (available in Microsoft implementation of Windows Sockets 2)
- SO_TYPE (int) Type of the socket
- Here are more details on some of the above options:
- SO_DEBUG: Windows Sockets service providers are encouraged (but not required) to supply output debug information if the SO_DEBUG option is set by an application. The mechanism for generating the debug information and the form it takes are beyond the scope of this document.
- SO_GROUP_PRIORITY: Reserved for future use with socket groups.
- SO_KEEPALIVE: An application can request that a TCP/IP provider enable the use of "keep-alive" packets on TCP connections by turning on the SO_KEEPALIVE socket option. A Windows Sockets provider need not support the use of keep-alives. If it does, the precise semantics are implementation-specific but should conform to section 4.2.3.6 of RFC 1122: Requirements for Internet Hosts — Communication Layers. If a connection is dropped as the result of "keep-alives" the error code WSAENETRESET is returned to any calls in progress on the socket, and any subsequent calls will fail with WSAENOTCONN.
- SO_LINGER:
The SO_LINGER option controls the action taken when unsent data is queued on a socket and a closesocket is performed. See closesocket for a description of the way in which the SO_LINGER settings affect the semantics of closesocket. The application sets the desired behavior by creating a LINGER structure (pointed to by the optval parameter) with these members l_onoff and l_linger set appropriately.
- SO_REUSEADDR:
By default, a socket cannot be bound (see bind) to a local address that is already in use. On occasion, however, it can be necessary to "re-use" an address in this way. Since every connection is uniquely identified by the combination of local and remote addresses, there is no problem with having two sockets bound to the same local address as long as the remote addresses are different. To inform the Windows Sockets provider that a bind on a socket should not be disallowed because the desired address is already in use by another socket, the application should set the SO_REUSEADDR socket option for the socket before issuing the bind. The option is interpreted only at the time of the bind. It is therefore unnecessary and harmless to set the option on a socket that is not to be bound to an existing address. Setting or resetting the option after the bind has no effect on this or any other socket.
- SO_RCVBUF and SO_SNDBUF:
When a Windows Sockets implementation supports the SO_RCVBUF and SO_SNDBUF options, an application can request different buffer sizes (larger or smaller). The call to setsockopt can succeed even when the implementation did not provide the whole amount requested. An application must call getsockopt with the same option to check the buffer size actually provided.
- PVD_CONFIG:
This object stores the configuration information for the service provider associated with the socket specified in the s parameter. The exact format of this data structure is specific to each service provider.
- TCP_NODELAY:
The TCP_NODELAY option is specific to TCP/IP service providers. The Nagle algorithm is disabled if the TCP_NODELAY option is enabled (and vice versa). The process involves buffering send data when there is unacknowledged data already "in flight" or buffering send data until a full-size packet can be sent. It is highly recommended that TCP/IP service providers enable the Nagle Algorithm by default, and for the vast majority of application protocols the Nagle Algorithm can deliver significant performance enhancements. However, for some applications this algorithm can impede performance, and TCP_NODELAY can be used to turn it off. These are applications where many small messages are sent, and the time delays between the messages are maintained. Application writers should not set TCP_NODELAY unless the impact of doing so is well-understood and desired because setting TCP_NODELAY can have a significant negative impact on network and application performance.
Windows CE: The SO_RCVBUF option is not supported. If you attempt to use this option setsockopt returns WSAEOPNOTSUPP.
To set the socket to secure mode, the option level parameter, level, must set to SO_SOCKET, the option name, optname to SO_SECURE, and the option value, optval, must be a pointer to a DWORD containing SO_SEC_SSL. These settings ensure that the Unified Secure Sockets Layer (SSL) package be used. For example,
In addition to the normal error values, the setsockopt function can return an additional error code, namely, WSAEISCONN, to signify that the socket can not switch to secure mode once it has been connected.
When used in the context of SSL, the WSAENOPROTOOP error code acquires additional meaning, to indicate that the option level does not equal to SO_SOCKET.
(end extract)
The above is only slightly modified and is probably
copyrighted by Microsoft. I copied this tiny fraction
of the documentation for educational purposes and
without permission from Microsoft. Such should be covered
under "fair use".
-
tye
(but my friends call me "Tye")
| [reply] |