- /* This kills the dummy connection. */
- close(fds2[1]);
- return io_read(buf, 16, io_close_cb, NULL);
+ return io_read(conn, buf, 16, io_close_cb, NULL);
+}
+
+static struct io_plan *setup_waiter(struct io_conn *conn, char *buf)
+{
+ return io_wait(conn, buf, read_in, buf);
+}
+
+static struct io_plan *wake_and_close(struct io_conn *conn, char *buf)
+{
+ io_wake(buf);
+ return io_close(conn);
+}
+
+static struct io_plan *setup_waker(struct io_conn *conn, char *buf)
+{
+ return io_read(conn, buf, 1, wake_and_close, buf);