-static void init_conn(int fd, struct data *d)
-{
- if (!io_new_conn(fd, start_ok, finish_ok, d))
- abort();
+ 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);