Ravi Kota wrote:
> Hi,
> We are using setsockopt() in C/C++ to alter TCP_KEEPALIVE at the TCP 
> protocol  level  
>    
>     The function is being called with the following parameters.
> 
>     nResult = setsockopt(ctx->socket, IPPROTO_TCP, TCP_KEEPALIVE,
>     &optval, optlen);
> 
> Since SOL_TCP isn't defined, so we are using IPPROTO_TCP. The call 
> appears to always return an error condition with
> errno=99 (ENOPROTOOPT).
> 
> The specific error is:
> 
>     setsockopt() failure: : Option not supported by protocol
>     Errno=99, failed to set TCP_KEEPALIVE value
> 
> Is this supported on Solaris 10/ OpenSolaris.  If so, what is the 
> correct usage of this call? 


The option level should be SOL_SOCKET.  And I think it is
better to use SO_KEEPALIVE, instead of TCP_KEEPALIVE (they
have the same value though).  Refer to the setsockopt(3SOCKET)
man page.



-- 

                                                K. Poon.
                                                [EMAIL PROTECTED]

_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to