webtorrent v0.91.0 Release Notes
Release Date: 2016-04-21 // about 8 years ago-
โ Added
๐ฆ
client.listening
property to signal whether TCP server is listening for incoming connections.client.dhtPort
property reflects the actual DHT port when user doesn't specify one (this is parallel toclient.torrentPort
for the TCP torrent listening server)
๐ Changed
๐ Merged
Swarm
class intoTorrent
object. Properties ontorrent.swarm
(liketorrent.swarm.wires
) now exist ontorrent
(e.g.torrent.wires
).๐ Deprecate: Do not use
torrent.swarm
anymore. Usetorrent
instead.torrent.addPeer
can no longer be called before theinfoHash
event has been emitted.โ Remove
torrent.on('listening')
event. Useclient.on('listening')
instead.โ Remove support from
TCPPool
for listening on multiple ports. This was not used by WebTorrent and just added complexity. There is now a singleTCPPool
instance for the whole WebTorrent client.๐ Deprecate: Do not use
client.download()
anymore. Useclient.add()
instead.Only pass
torrent.infoHash
to the Chunk Store constructor, instead of theTorrent
instance itself, to prevent accidental memory leaks of theTorrent
object by the store. (Open an issue if you were using other properties. They can be re-added.)Non-fatal errors with a single torrent will be emitted at
torrent.on('error')
. You should listen to this event. Previously, all torrent errors were also emitted onclient.on('error')
and handlingtorrent.on('error')
was optional. This design is better since now it is possible to distinguish between fatal client errors (client.on('error')
) when the whole client becomes unusable versus recoverable errors where only a single torrent fails (torrent.on('error')
) but the client can continue to be used. However, if there is notorrent.on('error')
event, then the error will be forwarded toclient.on('error')
. This prevents crashing the client when the user only has a listener on the client, but it makes it impossible for them to determine a client error versus a torrent error.โ Removed
torrent.numBlockedPeers
property. Use theblockedPeer
event to track this yourself.
๐ Fixed
If
client.get
is passed aTorrent
instance, it now only returns it if it is present in the client.๐ Errors creating a torrent with
client.seed
are now emitted on the returnedtorrent
object instead of the client (unless there is no event listeners ontorrent.on('error')
as previously discussed). The torrent object is now also destroyed automatically for the user, as was probably expected.Do not return existing torrent object when duplicate torrent is added. Fire an
'error'
event instead.Memory leaks of
Torrent
object caused by many internal subclasses of WebTorrent, includingRarityMap
,TCPPool
,WebConn
,Server
,File
.client.ratio
andtorrent.ratio
are now calculated asuploaded / received
instead ofuploaded / downloaded
.