- ok1(io_duplex(conn, write_out, finish_ok, d));
- return io_read(d->buf, sizeof(d->buf), io_next(conn, io_close, d));
+
+ conn = io_new_conn(fd, io_read(d->buf, sizeof(d->buf), io_close_cb, d));
+ io_set_finish(conn, finish_ok, d);
+ conn = io_duplex(conn, io_write(d->wbuf, sizeof(d->wbuf), write_done, d));
+ ok1(conn);
+ io_set_finish(conn, finish_ok, d);