Sean Boudreau(deleted)
|
Re: getsockopt() and the optval parameter
|
Sean Boudreau(deleted)
01/02/2015 9:58 AM
post112802
|
Re: getsockopt() and the optval parameter
On Fri, Dec 26, 2014 at 11:33:57AM -0500, Victor Gomez wrote:
> Hi all,
>
> I am using the getsockopt() API in QNX,
>
> getsockopt(socket,
> level,
> optName,
> (void *)optVal,
> (socklen_t *)optLen),
>
> , using these parameters:
>
> getsockopt(clientSocket,
> SOL_SOCKET,
> SO_KEEPALIVE,
> &socketOption,
> &socketOptionLen);
>
> The socketOption is just an 32-bit integer, and I expect it to be just a pointer to the value of SO_KEEPALIVE. If I
print it as a decimal, with %d, I get an "8". Depending on the option, this value changes, form "8", to "0", to "22528",
depending on the option that I use. Where can I find documentation about what to expect on the socketOption?
>
> I want to write code that after making this call verifues that the option was properly set. Right now, I have smth
like "assert(socketOption==TRUE)", but this is not working properly.
For the ones that are simple enable / disable:
SO_USELOOPBACK:
SO_DONTROUTE:
SO_DEBUG:
SO_KEEPALIVE:
SO_REUSEADDR:
SO_REUSEPORT:
SO_BROADCAST:
SO_OOBINLINE:
SO_TIMESTAMP:
SO_ACCEPTCONN:
The optval will be 0 if not set and non zero if set.
|
|
|