[Ace-users] Setting the TCP keep-alive socket option via ACE in Solaris 10

BlueJayWay sgrsgrsgr at gmail.com
Fri Jan 4 11:41:00 CST 2008


    ACE VERSION:
	5.6

    HOST MACHINE and OPERATING SYSTEM:
	SunOS rega 5.10 Generic_118833-17 sun4u sparc SUNW,Netra-T4

    COMPILER NAME AND VERSION (AND PATCHLEVEL):
	gcc (GCC) 3.4.6

    THE $ACE_ROOT/ace/config.h FILE:
	config-sunos5.9.h

    THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:
	platform_sunos5_g++.GNU

    AREA/CLASS/EXAMPLE AFFECTED:

    DOES THE PROBLEM AFFECT:
        COMPILATION?
        LINKING?
            On Unix systems, did you run make realclean first?
        EXECUTION?
        OTHER (please specify)?
[Please indicate whether ACE, your application, or both are affected.]

    SYNOPSIS:
How to set the TCP keep alive socket option via ACE in Solaris 10?

    DESCRIPTION:
I know that it's often better to have the application code handle its
own keep-alive mechanism for the TCP socket that it uses, but I just
want to know the correct way to enable the Solaris generic keep-alive
mechanism.
I see that Solaris has an ndd /dev/tcp/tcp_keepalive_timeout parameter
that has a default of 2 hours.  I assume that you have to set either
the SO_KEEPALIVE or TCP_KEEPALIVE option when the socket is
established.

I took a quick look in the "C++ Network Programming Vol 1" book, but
didn't see anything.

  Thanks

    REPEAT BY:
[What you did to get the error; include test program or
session transcript if at all possible.]

    SAMPLE FIX/WORKAROUND:
[If available ]


More information about the Ace-users mailing list