con_ready_check(void *ctx, double now) {
    agooCon	c = (agooCon)ctx;

    if (c->dead || 0 == c->sock) {
	if (remove_dead_res(c)) {
	    return true;
	}
    } else if (0.0 == c->timeout || now < c->timeout) {
	return false;
    } else if (c->closing) {
	if (remove_dead_res(c)) {
	    return true;
	}
    } else if (AGOO_CON_WS == c->bind->kind || AGOO_CON_SSE == c->bind->kind) {
	c->timeout = dtime() + CON_TIMEOUT;
	if (AGOO_CON_WS == c->bind->kind) {
	    agoo_ws_ping(c);
	}
	return false;
    } else {
	c->closing = true;
	c->timeout = now + 0.5;
    }
    return false;
}
con_ready_check(void *ctx, double now) {
    agooCon	c = (agooCon)ctx;

    if (c->dead || 0 == c->sock) {
	if (remove_dead_res(c)) {
	    return true;
	}
    } else if (0.0 == c->timeout || now < c->timeout) {
	return false;
    } else if (c->closing) {
	if (remove_dead_res(c)) {
	    return true;
	}
    } else if (AGOO_CON_WS == c->bind->kind || AGOO_CON_SSE == c->bind->kind) {
	c->timeout = dtime() + CON_TIMEOUT;
	if (AGOO_CON_WS == c->bind->kind) {
	    agoo_ws_ping(c);
	}
	return false;
    } else {
	c->closing = true;
	c->timeout = now + 0.5;
    }
    return false;
}