io: remove io_debug support. It seemed like a good idea, but it complicates things and I never used it (since I never really trusted that the alternate paths would be equivalent). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/io: io_halfclose. Helper for a common case. Replace all but 1 in tests. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/io: implement debug. Now a simple flag, with an external toggle (no compile time DEBUG define required). But it's completely synchronous. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/io: implement timeouts. We do this by the simplest method: return from io_loop() and let the caller sort them out. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/io: duplex support. This is actually pretty simple now. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/io: rewrite. I found it difficult to use myself, particularly io_duplex(). So this removes that, as well as timers and debug (for the moment). API changes: 1) An io_plan is passed by pointer, rather than copied on the stack. 3) All io_plans are generated using the struct io_conn. 3) tal is the allocator. 4) A new connection must be set up with a callback, so this is now the same as one generated from a listener. 5) io_read_partial and io_write_partial take an explicit length. 6) io_always() and io_wait() take an explit in/out arg. 7) io_break() does not return a plan. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
io: change io_idle() to io_wait() Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
io: io_close_other() And add test for that which also tests duplex case. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>