2 #include <sys/socket.h>
4 * Initializes socket handling and spawns a background thread to handle socket
5 * events and pass them to the given LDKPeerManager.
7 * Returns NULL on error, otherwise an opaque pointer which should be passed as
8 * `handler` in the remaining functions.
10 void* init_socket_handling(const struct LDKPeerManager *NONNULL_PTR ldk_peer_manger);
12 * Stop the socket handling thread and free socket handling resources for the
13 * given handler, as returned by init_socket_handling.
15 void interrupt_socket_handling(void* handler);
17 * Bind the given address to accept incoming connections on the given handler's
19 * Returns 0 on success.
21 int socket_bind(void* handler, struct sockaddr *addr, socklen_t addrlen);
23 * Connect to the given address and handle socket events on the given handler's
25 * Returns 0 on success.
27 int socket_connect(void* handler, LDKPublicKey counterparty_pubkey, struct sockaddr *addr, size_t addrlen);