fdbus icon indicating copy to clipboard operation
fdbus copied to clipboard

QNX下编译找不到TCP_KEEPIDLE TCP_KEEPINTVL TCP_KEEPCNT

Open thun-res opened this issue 4 years ago • 1 comments

if (setsockopt(CastToSocket(socket), IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val)) < 0) {
    return false;
}

/* Send next probes after the specified interval. Note that we set the
 * delay as interval / 3, as we send three probes before detecting
 * an error (see the next setsockopt call). */
val = interval / count;
if (val == 0) val = 1;
if (setsockopt(CastToSocket(socket), IPPROTO_TCP, TCP_KEEPINTVL, &val, sizeof(val)) < 0) {
    return false;
}

/* Consider the socket in error state after three we send three ACK
 * probes without getting a reply. */
val = count;
if (setsockopt(CastToSocket(socket), IPPROTO_TCP, TCP_KEEPCNT, &val, sizeof(val)) < 0) {
    return false;
}

thun-res avatar Jan 05 '21 01:01 thun-res

Sorry already fixed: for QNX -Dfdbus_QNX_KEEPALIVE=ON should be added to QNX.

jeremyczhen avatar Jan 06 '21 05:01 jeremyczhen