You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by DaveBirdsall <gi...@git.apache.org> on 2018/03/22 16:11:36 UTC
[GitHub] trafodion pull request #1487: [TRAFODION-3003]Trafodion keepalive support
Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1487#discussion_r176477432
--- Diff: core/conn/odbc/src/odbc/nsksrvr/Interface/Listener_srvr.cpp ---
@@ -81,4 +81,46 @@ void CNSKListenerSrvr::TCP_PROCESSNAME_PORT(FILE* fp)
fprintf(fp,"<==========TCP/PORT (%s/%d)==========>\n",m_TcpProcessName, m_port);
}
+void CNSKListenerSrvr::TCP_SetKeepalive(int socketnum,
+ char *keepaliveStatus,
+ int idleTime,
+ int intervalTime,
+ int retryCount)
+{
+ //all need to be configured
+ if(NULL == keepaliveStatus){
+ return;
+ }
+ if(0 == strcmp(keepaliveStatus,"default")){
+ keepaliveOpt.isKeepalive = DEFAULT_KEEPALIVE;
+ keepaliveOpt.keepaliveIdle = DEFAULT_KEEPALIVE_TIMESEC;
+ keepaliveOpt.keepaliveInterval = DEFAULT_KEEPALIVE_INTVL;
+ keepaliveOpt.keepCount = DEFAULT_KEEPALIVE_COUNT;
+ }else
+ if(0 == strcmp(keepaliveStatus,"unenable")){
+ keepaliveOpt.isKeepalive = 0;
+ keepaliveOpt.keepaliveIdle = DEFAULT_KEEPALIVE_TIMESEC;
+ keepaliveOpt.keepaliveInterval = DEFAULT_KEEPALIVE_INTVL;
+ keepaliveOpt.keepCount = DEFAULT_KEEPALIVE_COUNT;
+ }else
+ if(0 == strcmp(keepaliveStatus, "enable")){
+ keepaliveOpt.isKeepalive = 1;
+ keepaliveOpt.keepaliveIdle = idleTime;
+ keepaliveOpt.keepaliveInterval = intervalTime;
+ keepaliveOpt.keepCount = retryCount;
+
+ }else{
+ keepaliveOpt.isKeepalive = 0;
--- End diff --
Why are the other members (keepaliveIdle and so on) not set in this code path? (I assume it matters since we set them in the "unenable" code path.)
---