X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fio%2Fio.h;h=8199bda9802050f747440f66ec1da97f987fcb47;hp=105a90825dcea8caf53cdb1ec1ce25890acdf53e;hb=3a7b8a8a8081ebbb6457527de376dec6264bc381;hpb=869dc1528e64604e9264c6f12e0f2cb79bf3d79e diff --git a/ccan/io/io.h b/ccan/io/io.h index 105a9082..8199bda9 100644 --- a/ccan/io/io.h +++ b/ccan/io/io.h @@ -290,17 +290,20 @@ struct io_plan io_break_(void *ret, struct io_plan plan); /* FIXME: io_recvfrom/io_sendto */ /** - * io_close - terminate a connection. - * @conn: any connection. + * io_close - plan to close a connection. * - * The schedules a connection to be closed. It can be done on any - * connection, whether it has I/O queued or not (though that I/O may - * be performed first). + * On return to io_loop, the connection will be closed. + */ +struct io_plan io_close(void); + +/** + * io_close_cb - helper callback to close a connection. + * @conn: the connection. * - * It's common to 'return io_close(...)' from a @next function, but - * io_close can also be used as an argument to io_next(). + * This schedules a connection to be closed; designed to be used as + * a callback function. */ -struct io_plan io_close(struct io_conn *, void *unused); +struct io_plan io_close_cb(struct io_conn *, void *unused); /** * io_loop - process fds until all closed on io_break.