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

Function connection_in

connectd/connectd.c:707–727  ·  view source on GitHub ↗

~ When we get a direct connection in we set up its network address * then call handshake.c to set up the crypto state. */

Source from the content-addressed store, hash-verified

705/*~ When we get a direct connection in we set up its network address
706 * then call handshake.c to set up the crypto state. */
707static struct io_plan *connection_in(struct io_conn *conn,
708 struct daemon *daemon)
709{
710 struct conn_in conn_in_arg;
711
712 /* Did we fail to accept? */
713 if (!conn)
714 return accept_failed(daemon);
715
716 conn_in_arg.addr.u.wireaddr.is_websocket = false;
717 if (!get_remote_address(conn, &conn_in_arg.addr))
718 return io_close(conn);
719
720 /* Don't try to set TCP options on UNIX socket! */
721 if (conn_in_arg.addr.itype == ADDR_INTERNAL_WIREADDR)
722 set_tcp_no_delay(daemon, io_conn_fd(conn));
723
724 conn_in_arg.daemon = daemon;
725 conn_in_arg.is_websocket = false;
726 return conn_in(conn, &conn_in_arg);
727}
728
729/*~ <hello>I speak web socket</hello>.
730 *

Callers

nothing calls this directly

Calls 6

accept_failedFunction · 0.85
get_remote_addressFunction · 0.85
io_closeFunction · 0.85
set_tcp_no_delayFunction · 0.85
io_conn_fdFunction · 0.85
conn_inFunction · 0.70

Tested by

no test coverage detected