Question about Resources & the file transfer example #313
-
Now that I understand Links (not comprehensively but good for now), I need to learn about using Resource objects so I'm looking at the file transfer example. I figured out from the RNS source code how a resource transfer is started:
Q1: the default value for advertise is True, so does the transfer start upon immediately after the Resource is created? Most of the code for the example is pretty clear. I see how the "file_resource" (an instance of RNS.Resource) is created in the client_request handler of the server and how it's associated with the link, and sets a callback, but I don't see a "filename" property in the API or the RNS source. Q2: Can anyone explain this line of code in the example: file_resource.filename = filename? Should it be |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
By default, a Once the
The |
Beta Was this translation helpful? Give feedback.
By default, a
Resource
is advertised over the link as soon as it is created. This behaviour can be disabled if you want to do something else first, and then manually advertise it.Once the
Resource
has been advertised, it is up to the receiver whether or not to accept it. This follows a general principle in Reticulum. It is always up to the receiving party to ask for more information, and stuff will not be sent to a receiver, unless it has asked for it.The
filename
property t…