HP Rp7410 BSD Sockets Interface Programmer's Guide - Page 63
Parameter, Contents, INPUT Value, OUTPUT, Value
View all HP Rp7410 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 63 highlights
Advanced Topics for Stream Sockets Socket Options Parameter Contents s socket descriptor level optname optval optlen protocol level name of option pointer to current value of option pointer to length of optval INPUT Value socket descriptor for which option values are to be returned SOL_SOCKET supported option name pointer to buffer where option's current value is to be returned pointer to maximum number of bytes to be returned by optval OUTPUT Value unchanged unchanged unchanged pointer to buffer that contains current option value pointer to actual size of optval returned Function result: 0 if the option is set. If getsockopt fails for any reason, the function returns -1, and the option is not returned. An error code is stored in errno. Example: len = sizeof (optval)) getsockopt(s, SOL_SOCKET, SO_REUSEADDR, &optval, &len;) optval may never be zero. It must always point to data sent with the socket option and must always be at least the size of an integer. The following socket options set socket parameter values. optval is an integer containing the new value: • SO_SNDBUF • SO_RCVBUF • SO_SNDLOWAT • SO_RCVLOWAT • SO_SNDTIMEO Chapter 3 63