- ok1(io_duplex(conn, write_out, finish_ok, d));
- return io_read(conn, d->buf, sizeof(d->buf), io_close, d);
+ io_set_finish(conn, finish_ok, d);
+
+ return io_duplex(conn,
+ io_read(conn, d->buf, sizeof(d->buf), r_done, d),
+ io_write(conn, d->wbuf, sizeof(d->wbuf), w_done, d));