| 137 | } |
| 138 | |
| 139 | struct daemon_conn *daemon_conn_new_(const tal_t *ctx, int fd, |
| 140 | struct io_plan *(*recv)(struct io_conn *, |
| 141 | const u8 *, |
| 142 | void *), |
| 143 | void (*outq_empty)(void *), |
| 144 | void *arg) |
| 145 | { |
| 146 | struct daemon_conn *dc = tal(NULL, struct daemon_conn); |
| 147 | |
| 148 | dc->recv = recv; |
| 149 | dc->outq_empty = outq_empty; |
| 150 | dc->arg = arg; |
| 151 | dc->msg_in = NULL; |
| 152 | dc->out = msg_queue_new(dc, true); |
| 153 | |
| 154 | dc->conn = io_new_conn(dc, fd, daemon_conn_start, dc); |
| 155 | tal_add_destructor2(dc->conn, destroy_dc_from_conn, dc); |
| 156 | return dc; |
| 157 | } |
| 158 | |
| 159 | void daemon_conn_send(struct daemon_conn *dc, const u8 *msg) |
| 160 | { |
nothing calls this directly
no test coverage detected