mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-14 11:26:25 +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) {
|
||||
var self = this
|
||||
if (self.destroyed) return
|
||||
|
@ -3,8 +3,6 @@ module.exports = Tracker
|
||||
var EventEmitter = require('events').EventEmitter
|
||||
var inherits = require('inherits')
|
||||
|
||||
var common = require('../common')
|
||||
|
||||
inherits(Tracker, EventEmitter)
|
||||
|
||||
function Tracker (client, announceUrl) {
|
||||
@ -20,7 +18,7 @@ function Tracker (client, announceUrl) {
|
||||
Tracker.prototype.setInterval = function (intervalMs) {
|
||||
var self = this
|
||||
if (self.interval) return
|
||||
if (intervalMs == null) intervalMs = common.DEFAULT_ANNOUNCE_INTERVAL
|
||||
if (intervalMs == null) intervalMs = self.DEFAULT_ANNOUNCE_INTERVAL
|
||||
|
||||
clearInterval(self.interval)
|
||||
|
||||
|
@ -30,6 +30,8 @@ function UDPTracker (client, announceUrl, opts) {
|
||||
self.cleanupFns = []
|
||||
}
|
||||
|
||||
UDPTracker.prototype.DEFAULT_ANNOUNCE_INTERVAL = 30 * 60 * 1000 // 30 minutes
|
||||
|
||||
UDPTracker.prototype.announce = function (opts) {
|
||||
var self = this
|
||||
if (self.destroyed) return
|
||||
|
@ -32,6 +32,8 @@ function WebSocketTracker (client, announceUrl, opts) {
|
||||
self._openSocket()
|
||||
}
|
||||
|
||||
WebSocketTracker.prototype.DEFAULT_ANNOUNCE_INTERVAL = 30 * 1000 // 30 seconds
|
||||
|
||||
WebSocketTracker.prototype.announce = function (opts) {
|
||||
var self = this
|
||||
if (self.destroyed) return
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
var extend = require('xtend/mutable')
|
||||
|
||||
exports.DEFAULT_ANNOUNCE_INTERVAL = 30 * 60 * 1000 // 30 minutes
|
||||
|
||||
exports.DEFAULT_ANNOUNCE_PEERS = 50
|
||||
exports.MAX_ANNOUNCE_PEERS = 82
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user