MCPcopy Create free account
hub / github.com/ElementsProject/lightning / daemon_conn_new_

Function daemon_conn_new_

common/daemon_conn.c:139–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139struct 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
159void daemon_conn_send(struct daemon_conn *dc, const u8 *msg)
160{

Callers

nothing calls this directly

Calls 1

msg_queue_newFunction · 0.85

Tested by

no test coverage detected