Comments (4)
I was intending bip_handshake
to be a central crate for all peer discovery services (trackers, dht, pex, etc) to be able to forward contact information to in an asynchronous fashion (synchronous is possible, but our BTHandshaker
just sends the connect over to the mio event loop asynchronously). Because of this, I wouldn't have to export an asynchronous interface (token or callback based) for every peer discovery service, they would just asynchronously forward the contact information over to the Handshaker
which would act on that information. This is because in most cases, this is what the client wants anyway, for other cases, see my last block of text.
However as you can see, some services also have metadata associated with requests such as trackers which, in addition to contact information, also return swarm statistics, and announce intervals and for these, I have no choice but to offer a crate specific asynchronous interface, but the contact information is still passed through the Handshaker
asynchronously and so is not exposed with the metadata. Services like the DHT don't have metadata associated with requests so it was not necessary to have anything other than the Handshaker
(not sure about PEX).
To address your second point, the Handshaker
was intended to be composable so that if you wanted to, you could provide a sort of MockHandshaker
which could pool or forward the connection requests to a client wanting to have more control over things.
from bip-rs.
Yes, I do intend to start a project that combines the various crates. Such a project would be external to bip-rs
and would be sort of a reference torrent client similar to what libtorrent
offers.
However, currently I am working on the bip_peer
module so such an application wouldn't start development anytime soon. That being said, I appreciate the use cases you are bringing up as it is helpful in rethinking how each of the bip_*
modules fit together.
from bip-rs.
Just to add on to my first comment, coupling the peer discovery services and the Handshaker
was intended. However, approaching this issue from the perspective of a client that needs loose coupling (at least loose coupling from BTHandshaker
) they can provide their own Handshaker and do whatever they want with the information provided to it.
from bip-rs.
Ok.
To me the moniker Handshaker
indicated that this was all about initiating wire connections. For the other purpose, how about calling that something like SwarmInfo
?
from bip-rs.
Related Issues (20)
- Follow Sink Buffer Conventions For DiskManager
- Debug High CPU Usage For simple_torrent HOT 3
- Extract Compact Ip Parsing Logic To bip_util
- Using bip_utracker HOT 2
- Unable to run bip_dht example HOT 2
- Lifetimes and construction of BencodeMut trees HOT 4
- Accept Two Transport Types In Handshaker
- Add Extensions Info To PeerInfo
- Add Builder For ExtendedMessage
- Support Write Interface For Bencode Encoding HOT 1
- Integrate Hashed Timing Wheel (Data Structure) Into bip_select
- Extract Extended Logic In bip_select Into Separate Module
- Unused mut warning when using ben_map macro HOT 1
- Create BlockIdentifier Message Type HOT 1
- Re-Evaluate Backpressure In bip_select
- Setters of `MetainfoBuilder` incorrectly works with result of `BTreeMap::insert` method. HOT 4
- How to make a bittorent dht crawler with using bip-rs
- Support arbitrary data in DHT (BEP 44)?
- Publish a new version of bip_metainfo?
- bip_peer depends on buggy version of crossbeam HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bip-rs.