How can I limit data transfer to direct connections? #6051
-
I'm building a file sharing app that uses both mdns and kademlia for peer discovery. As it's supposed to run on consumer devices, I also use relays and dcutr to establish direct connections. The actual transfer is done using request-response. If my understanding is correct, I can just use My issue is that this initial connection is most likely going to be a relayed one, and the relay's limit will not permit me to send a file of any significant size. So I wonder how I would ensure that the data is only sent via the direct connection that dcutr will attempt to establish, and only if dcutr succeeds at that. I do not want to send any data via the relay. Is that currently possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
There is no direct peer discovery when calling
You can increase the size of the data transmission on the relay server side if needed. You could also wait until dcutr emits an event stating that the connection was established then proceed to send the request from there. |
Beta Was this translation helpful? Give feedback.
I believe it means, unless the address is known by
request-response
, either via manually adding and removing through itsBehaviour
interface, or a successful connection initiated by aNetworkBehaviour
with peer discovery capabilities(implies emitting ofNewExternalAddrOfPeer
), no connection will be initated byrequest-response
.Consider how it handles
FromSwarm
: