Closed davay42 closed 5 years ago
RPC is useful for calling a function on some node and then receiving the result of that function. That's why the address of the node is required (I need to update the error message to say "address" not public key).
When sending mouse / MIDI I guess you aren't looking for a reply from the other side. In this case you should use send
yes. RPC is actually less efficient than send as it has to do a bunch of work to track responses.
I test the code from docs in my app and can't figure out how to call a public RPC without the address as the first argument. With
b.rpc("ping", {"Hello": "world"}, console.log("response:"));
i getping not seen - no public key.
As i understand RPC can be better to use to send many small packets (like mouseposition or midi) than the b.send() method, isn't it? Is it optimized some how better than if I send
{type:'type',{data:'data'}}
messages withb.send()
?