upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/btfrv.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/btfrv.h')
-rw-r--r--src/btfrv.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/btfrv.h b/src/btfrv.h
index c776201..9d6756e 100644
--- a/src/btfrv.h
+++ b/src/btfrv.h
@@ -37,11 +37,20 @@ bool RvRelayRun(unsigned short port);
37void RvRelayStop(); 37void RvRelayStop();
38 38
39// ---- service side (the node being reached by its .btf address) ---- 39// ---- service side (the node being reached by its .btf address) ----
40// Register at the relay under `my_pubkey` (32 bytes) and block until a client is 40// Register at the relay under `my_pubkey` (32 bytes). Returns as soon as the
41// paired to us. Returns the paired socket, or RV_INVALID on error. 41// relay has us listed, WITHOUT waiting for anyone to dial -- the caller needs
42// that moment to start advertising this relay as its meeting node. Waiting for
43// the dial was folded into this call before, which deadlocked discovery: a node
44// could not be advertised until it had been dialled, and could not be dialled
45// until it was advertised. Returns RV_INVALID on error.
42RvSocket RvServiceRegister(const char* relay_host, unsigned short port, 46RvSocket RvServiceRegister(const char* relay_host, unsigned short port,
43 const unsigned char my_pubkey[32]); 47 const unsigned char my_pubkey[32]);
44 48
49// Block on a registered service socket until a client is paired to us. Returns
50// false if the relay drops us or errors, in which case the caller should close
51// the socket and register again.
52bool RvServiceWaitPaired(RvSocket s);
53
45// ---- client side (the node dialing a .btf address) ---- 54// ---- client side (the node dialing a .btf address) ----
46// Connect through the relay to the service registered under `target_pubkey`. 55// Connect through the relay to the service registered under `target_pubkey`.
47// Returns the paired socket, or RV_INVALID on error. 56// Returns the paired socket, or RV_INVALID on error.