Ecosyste.ms: OpenCollective
An open API service for software projects hosted on Open Collective.
MonoTorrent
The official repository for MonoTorrent, a bittorrent library for .NET
Collective -
Host: opensource -
https://opencollective.com/monotorrent
- Code: https://github.com/alanmcgovern/monotorrent
All we really care about is that the task returned by
'SendAsync' or 'ReceiveAsync' does not blo...
The event is async so we should not rely on it executing before
the Announce task completes.
github.com/alanmcgovern/monotorrent - 8ad5efa7b230fb2b07b05b8834f923ff2092ea88 authored over 5 years ago by Alan McGovern <[email protected]>
Standard CancellationToken semantics!
github.com/alanmcgovern/monotorrent - fabe06f07852c94fb90794c78f59b1e4d5956f4d authored over 5 years ago by Alan McGovern <[email protected]>
It's concern is purely to receive broadcast messages and then
pass the data to the ClientEngine ...
github.com/alanmcgovern/monotorrent - 1782df3e6f6cb69e68e17df8a76e06c51c42f335 authored over 5 years ago by Alan McGovern <[email protected]>
The TrackerManager just needs a way to generate the appropriate
AnnounceParameters or ScrapePara...
Use Stopwatch instead of DateTime.[Utc]Now. Fix up some comments
to make them a bit more accurat...
These should be proxied to the main loop.
github.com/alanmcgovern/monotorrent - 710c02edd455ab43ebaf53d2002fe0a5af7d6961 authored over 5 years ago by Alan McGovern <[email protected]>Just covering a few more cases.
github.com/alanmcgovern/monotorrent - 59fd92bd7c7a5cef8cb4db88f28a331a986337f7 authored over 5 years ago by Alan McGovern <[email protected]>
This also fixes two bugs :) Firstly, it is allowed to set
'Tracker' to null when all Trackers fa...
github.com/alanmcgovern/monotorrent - ad268f075e8c1183d15646580bc9a3f964c27779 authored over 5 years ago by Alan McGovern <[email protected]>
Allows me to remove the old BeginSend/Receive methods.
github.com/alanmcgovern/monotorrent - f523c691211a06bca583fc2ccc5c0a222955f159 authored over 5 years ago by Alan McGovern <[email protected]>github.com/alanmcgovern/monotorrent - 44b61caf1bee55541fd1f36760f90286bb9d06f5 authored over 5 years ago by Alan McGovern <[email protected]>
If we need to await a Task we should have a timeout in case it
never actually completes.
This is easier than having to iterate over every Tracker and
attaching to individual events. As ...
The async/await changes make this a little easier to represent
using normal/sequential logic.
Also swap to autoprops in some places.
github.com/alanmcgovern/monotorrent - d3efaf41fb3f07a2455091ba053b545f98878f8c authored over 5 years ago by Alan McGovern <[email protected]>github.com/alanmcgovern/monotorrent - 876ec2acbaf46d047e487321cedf3340a9b5ce44 authored over 5 years ago by Alan McGovern <[email protected]>
github.com/alanmcgovern/monotorrent - 9b19e7d30478fd65c77785ccf5b5564772250a24 authored over 5 years ago by Alan McGovern <[email protected]>
github.com/alanmcgovern/monotorrent - 39b2d18cfd1e429976ca2dd785242fb288a2017a authored over 5 years ago by Alan McGovern <[email protected]>
The Async variants offer the same overloads as the synchronous
variants, and all the Async varia...
The simplifications we gained from async/await across the
codebase mean we no longer have confus...
We don't particularly want people mutating our objects
while we're using them, so hide the metho...
github.com/alanmcgovern/monotorrent - 3ddcf2a79c2118a3af66ef2613b9022e4913a405 authored over 5 years ago by Alan McGovern <[email protected]>
These are not supposed to be exposed to the public. They
are controlled exclusively by the engin...
This isn't for people to mess with. The engine manages this
value based on whether or not an enc...
They're not user-extendable/usable.
github.com/alanmcgovern/monotorrent - e49b7379f296a0cf5044143960e469d687ecba46 authored over 5 years ago by Alan McGovern <[email protected]>github.com/alanmcgovern/monotorrent - ca595840d3859a1fd411db366018c460a83c91db authored over 5 years ago by Alan McGovern <[email protected]>
This way we can associate an eventargs with each buffer from
our BufferManager and re-use that e...
Now that we're null out the Socket object we need to be careful
to null check the socket to avoi...
If we never send or receive any messages, we do want our timeout
to be hit. That means we need t...
There are better ways :p
github.com/alanmcgovern/monotorrent - 5e9fd5e0e145c593147e8c02bae68d8e28c8a44f authored over 5 years ago by Alan McGovern <[email protected]>
Rather than exporting a clone of the active request list and
then iterating it to see how many o...
We can instantiate the HaveMessage once and send it to many peers.
github.com/alanmcgovern/monotorrent - a173881feebc4abf7d85b2645dc3f6f6996c972e authored over 5 years ago by Alan McGovern <[email protected]>github.com/alanmcgovern/monotorrent - 88c38934b1b1f1ad63911852e9f4c8e5feca6836 authored over 5 years ago by Alan McGovern <[email protected]>
If either the DiskManager or SendMessageAsync methods throw
an exception we should still return ...
If we call 'Enqueue' we automatically kick off the messaging
sending logic to begin sending mess...
Since we've already instantiated a TaskCompletionSource we
should go ahead and populate it inste...
We can just cache and reuse them. Saves a few dozen MB of
allocations for a small torrent.
If we have a timer callback which executes every 1 minute, then
the objects referred to by that ...
When doing the initial population of pending requests we should
not add items for blocks which h...
github.com/alanmcgovern/monotorrent - 6bbfd7e5209f94de99a896789a141905859e45e0 authored over 5 years ago by Alan McGovern <[email protected]>
If we're swapping from downloading -> seeding we dispose every
connection where we know the othe...
This prevents it from retaining requests forever.
Partial fix for https://github.com/mono/monot...
github.com/alanmcgovern/monotorrent - 7f82dbe57f657a9b816313d89e2a1ad550b95e8d authored over 5 years ago by Alan McGovern <[email protected]>This is a little better memory-wise.
github.com/alanmcgovern/monotorrent - 97add39f07c7d7171e9e268b42a0bfcf35d79362 authored over 5 years ago by Alan McGovern <[email protected]>Small tweaks applied by Alan before commiting.
github.com/alanmcgovern/monotorrent - 3d54e0c79f0d9d33c63acc44044c8806e29e300a authored over 5 years ago by OneFingerCodingWarrior <[email protected]>github.com/alanmcgovern/monotorrent - 2c10b9c39f238ab42994c5155ce75b3156f00163 authored over 5 years ago by Alan McGovern <[email protected]>
github.com/alanmcgovern/monotorrent - 4810a70b430e549898a233c7fd0ac0577910c0c5 authored over 5 years ago by Alan McGovern <[email protected]>
Always add/remove from these two lists at the same time to ensure
they are always in sync.
As p...
github.com/alanmcgovern/monotorrent - 6782251216b175bed656701a0cdaa81f0a464bd3 authored over 5 years ago by Alan McGovern <[email protected]>
We can't guarantee that user subclasses of things like IConnection
won't throw exceptions, so le...
That way we can complete all our cleanup before disposing the
object.
Patch modified from chang...
github.com/alanmcgovern/monotorrent - 0e34c96dc2538c080930c0792647692283eb8064 authored over 5 years ago by Alan McGovern <[email protected]>
If we want to time out a message early, we just set Engine.Timeout
to be Zero. We don't need to ...
We just care that we send 5 messages every loop. We don't need
additional checks to rate limit.
This class is quite simple to unit test as it no longer
relies on any timing. The DhtEngine is r...
github.com/alanmcgovern/monotorrent - b96ea43a2442b9cc8c2fb5aa120adbfe226581b5 authored over 5 years ago by Alan McGovern <[email protected]>
Same reasoning as last time.
github.com/alanmcgovern/monotorrent - 77ae42902b24aa77a2c662228c67c5c38d6e0074 authored over 5 years ago by Alan McGovern <[email protected]>
Also use stopwatch instead of DateTime for calculating
deltas. Stopwatch timestamps are much che...
github.com/alanmcgovern/monotorrent - 30df5caa197d1c0f72932e850ecf4137737f81ff authored over 5 years ago by Alan McGovern <[email protected]>
github.com/alanmcgovern/monotorrent - ffc43f92122e474c96521ef800baa29f2c842b1b authored over 5 years ago by Alan McGovern <[email protected]>
If we call Seen then the FailedCount is set to zero, which is
the correct thing to do as this su...
github.com/alanmcgovern/monotorrent - 6d7daa3569f742634908becede1dce4f8e1b3793 authored over 5 years ago by Alan McGovern <[email protected]>
Use a normal abstract method to implement this feature, and
remove the reference to the 'Query' ...
Make stuff readonly.
Remove unused 'using' statements.
Add some license headers.
Slims up some code and makes it easier to probe for values.
github.com/alanmcgovern/monotorrent - 777dec402200ec5d1ffd4590d8436870afd838f8 authored over 5 years ago by Alan McGovern <[email protected]>
We can just increment an integer using the Interlocked class
and take the first two bytes of the...
They need to be compared in different ways at different places in
the codebase, so it's safer to...
Less memory overhead.
github.com/alanmcgovern/monotorrent - a1346dca9303345779fef63b1cb348c473e94faf authored over 5 years ago by Alan McGovern <[email protected]>github.com/alanmcgovern/monotorrent - 2115246dc43a22a832452ea5a222b55a93a32249 authored over 5 years ago by Alan McGovern <[email protected]>
Dht updates
github.com/alanmcgovern/monotorrent - 2b04ae0c6d2bee555d2d2f4f769f90d89327b261 authored over 5 years ago by Alan McGovern <[email protected]>
According to the spec a FindNodeResponse should contain a
'nodes' key, but some implementations ...
Technically this does not have to be a BEncodedString, so
let's accept any BEncodedValue from ot...
If the received dictionary doesn't have a message type identifier
then we should bail out immedi...
Because why not!
github.com/alanmcgovern/monotorrent - 6bb3bace14249d05fa4308982a351fbbc06f0106 authored over 5 years ago by Alan McGovern <[email protected]>
When we search for peers, we should keep track of the nodes
which responded to us. This way when...
This is a little simpler to deal with! It has the same semantics as
a HashSet - if a closer node...
This is now written in a similar style to InitialiseTask. It
sends as many messages concurrently...
We shouldn't wait for one message to time out before sending
the next announce message.
github.com/alanmcgovern/monotorrent - 0bbd90f8546596e72a51b9d0b8bc8420fa5aef2c authored over 5 years ago by Alan McGovern <[email protected]>
Use discard variables "_ =" to ignore returned Task objects
which we don't want to await.
The returned task used to wait for the full bootstrap to complete
(if one was needed). However t...
Now we can ensure all of the Dht engine interactions can be
performed in a non-blocking but thre...
Just reference the existing files instead of copying/pasting.
github.com/alanmcgovern/monotorrent - b82fb6d7ed53838db69a3ddfe0cd3773bc854b73 authored over 5 years ago by Alan McGovern <[email protected]>
We'll never raise events, so if anyone attaches event handlers
just discard them.
We don't want/need to Register it, we can just set a non-null
value on the property.
github.com/alanmcgovern/monotorrent - 9d468a19c4c9c491b8d1edb327838e59aea347fa authored over 5 years ago by Alan McGovern <[email protected]>
When we receive an ErrorMessage we should treat it like a
ResponseMessage - we need to unregiste...
The tests will use this to ensure that pending requests are
removed from the list when the respo...
Timeouts are either zero, or the default value. If we rely on
a message being sent, and a respon...
This is useful for tests when we want to time messages out on
purpose.
Send at most 5 messages every 5 milliseconds. This avoids the
possibility of overloading bad rou...
github.com/alanmcgovern/monotorrent - 2729c5715f33a428d7df7d4ae513253fd1083bd8 authored over 5 years ago by Alan McGovern <[email protected]>
The timeout is 15 minutes so there's no need to run the logic
once per second.
This test should send a PingResponse message as soon as a Ping
is sent so that the new nodes are...
Sometimes we'll want to respond with a Response message when a
Query is sent.
This is a slightly cleaner way of handling message timeouts.
It also ensures we always clean up ...
We don't actually count the active sends, nor should we! Once
a message is sent then we wait for...
github.com/alanmcgovern/monotorrent - 754adf29d0502bdf48a0ab94944126641d9e9f98 authored over 5 years ago by Alan McGovern <[email protected]>
If we receive a message we should immediately ensure we have both
a transaction id and a valid I...
When doing our loop we should iterate over all available
messages and process them in one go.