mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-14 19:36:24 +00:00
Announce to websocket tracker every 30 seconds (for #338)
This commit is contained in:
parent
9db28c2fad
commit
f5d2810c89
@ -34,6 +34,8 @@ function HTTPTracker (client, announceUrl, opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HTTPTracker.prototype.DEFAULT_ANNOUNCE_INTERVAL = 30 * 60 * 1000 // 30 minutes
|
||||||
|
|
||||||
HTTPTracker.prototype.announce = function (opts) {
|
HTTPTracker.prototype.announce = function (opts) {
|
||||||
var self = this
|
var self = this
|
||||||
if (self.destroyed) return
|
if (self.destroyed) return
|
||||||
|
@ -3,8 +3,6 @@ module.exports = Tracker
|
|||||||
var EventEmitter = require('events').EventEmitter
|
var EventEmitter = require('events').EventEmitter
|
||||||
var inherits = require('inherits')
|
var inherits = require('inherits')
|
||||||
|
|
||||||
var common = require('../common')
|
|
||||||
|
|
||||||
inherits(Tracker, EventEmitter)
|
inherits(Tracker, EventEmitter)
|
||||||
|
|
||||||
function Tracker (client, announceUrl) {
|
function Tracker (client, announceUrl) {
|
||||||
@ -20,7 +18,7 @@ function Tracker (client, announceUrl) {
|
|||||||
Tracker.prototype.setInterval = function (intervalMs) {
|
Tracker.prototype.setInterval = function (intervalMs) {
|
||||||
var self = this
|
var self = this
|
||||||
if (self.interval) return
|
if (self.interval) return
|
||||||
if (intervalMs == null) intervalMs = common.DEFAULT_ANNOUNCE_INTERVAL
|
if (intervalMs == null) intervalMs = self.DEFAULT_ANNOUNCE_INTERVAL
|
||||||
|
|
||||||
clearInterval(self.interval)
|
clearInterval(self.interval)
|
||||||
|
|
||||||
|
@ -30,6 +30,8 @@ function UDPTracker (client, announceUrl, opts) {
|
|||||||
self.cleanupFns = []
|
self.cleanupFns = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UDPTracker.prototype.DEFAULT_ANNOUNCE_INTERVAL = 30 * 60 * 1000 // 30 minutes
|
||||||
|
|
||||||
UDPTracker.prototype.announce = function (opts) {
|
UDPTracker.prototype.announce = function (opts) {
|
||||||
var self = this
|
var self = this
|
||||||
if (self.destroyed) return
|
if (self.destroyed) return
|
||||||
|
@ -32,6 +32,8 @@ function WebSocketTracker (client, announceUrl, opts) {
|
|||||||
self._openSocket()
|
self._openSocket()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WebSocketTracker.prototype.DEFAULT_ANNOUNCE_INTERVAL = 30 * 1000 // 30 seconds
|
||||||
|
|
||||||
WebSocketTracker.prototype.announce = function (opts) {
|
WebSocketTracker.prototype.announce = function (opts) {
|
||||||
var self = this
|
var self = this
|
||||||
if (self.destroyed) return
|
if (self.destroyed) return
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
var extend = require('xtend/mutable')
|
var extend = require('xtend/mutable')
|
||||||
|
|
||||||
exports.DEFAULT_ANNOUNCE_INTERVAL = 30 * 60 * 1000 // 30 minutes
|
|
||||||
|
|
||||||
exports.DEFAULT_ANNOUNCE_PEERS = 50
|
exports.DEFAULT_ANNOUNCE_PEERS = 50
|
||||||
exports.MAX_ANNOUNCE_PEERS = 82
|
exports.MAX_ANNOUNCE_PEERS = 82
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user