#define PORT "65014"
#endif
-#define is_idle(conn) ((conn)->plan.io == NULL)
-
struct data {
struct io_listener *l;
int state;
static struct io_plan end(struct io_conn *conn, struct data *d)
{
d->state++;
-
- /* last one out closes. */
- if (conn == d->c1 && is_idle(d->c2))
- return io_close();
-
- /* last one out closes. */
- if (conn == d->c2 && is_idle(d->c1))
- return io_close();
-
- return io_idle();
+ return io_close();
}
static struct io_plan make_duplex(struct io_conn *conn, struct data *d)