con_ready_write(void *ctx) {
    agooCon	c = (agooCon)ctx;
    agooRes	res = agoo_con_res_peek(c);

    if (NULL != res) {
	agooConKind	kind = res->con_kind;

	if (NULL != c->bind->write) {
	    if (c->bind->write(c)) {
		//if (kind != c->kind && AGOO_CON_ANY != kind) {
		if (AGOO_CON_ANY != kind) {
		    switch (kind) {
		    case AGOO_CON_WS:
			c->bind = &ws_bind;
			break;
		    case AGOO_CON_SSE:
			c->bind = &sse_bind;
			break;
		    default:
			break;
		    }
		}
		return true;
	    }
	}
    }
    c->dead = true;

    return false;
}
con_ready_write(void *ctx) {
    agooCon	c = (agooCon)ctx;
    agooRes	res = agoo_con_res_peek(c);

    if (NULL != res) {
	agooConKind	kind = res->con_kind;

	if (NULL != c->bind->write) {
	    if (c->bind->write(c)) {
		 
		if (AGOO_CON_ANY != kind) {
		    switch (kind) {
		    case AGOO_CON_WS:
			c->bind = &ws_bind;
			break;
		    case AGOO_CON_SSE:
			c->bind = &sse_bind;
			break;
		    default:
			break;
		    }
		}
		return true;
	    }
	}
    }
    c->dead = true;

    return false;
}