Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hyperswarm

Package Overview
Dependencies
Maintainers
4
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperswarm - npm Package Compare versions

Comparing version 4.7.3 to 4.7.4

38

index.js

@@ -174,2 +174,21 @@ const { EventEmitter } = require('events')

conn.on('open', () => {
opened = true
this._connectDone()
this.connections.add(conn)
conn.removeListener('error', noop)
peerInfo._connected()
peerInfo.client = true
this.emit('connection', conn, peerInfo)
this._flushMaybe(peerInfo)
this.emit('update')
})
conn.on('error', err => {
if (this.relayThrough && shouldForceRelaying(err.code)) {
peerInfo.forceRelaying = true
// Reset the attempts in order to fast connect to relay
peerInfo.attempts = 0
}
})
conn.on('close', () => {

@@ -191,22 +210,3 @@ if (!opened) this._connectDone()

})
conn.on('error', err => {
if (this.relayThrough && shouldForceRelaying(err.code)) {
peerInfo.forceRelaying = true
// Reset the attempts in order to fast connect to relay
peerInfo.attempts = 0
}
})
conn.on('open', () => {
opened = true
this._connectDone()
this.connections.add(conn)
conn.removeListener('error', noop)
peerInfo._connected()
peerInfo.client = true
this.emit('connection', conn, peerInfo)
this._flushMaybe(peerInfo)
this.emit('update')
})
this.emit('update')

@@ -213,0 +213,0 @@ }

const { EventEmitter } = require('events')
const b4a = require('b4a')
const MIN_CONNECTION_TIME = 15000
const VERY_LOW_PRIORITY = 0

@@ -19,2 +21,3 @@ const LOW_PRIORITY = 1

this.proven = false
this.connectedTime = -1
this.banned = false

@@ -63,6 +66,10 @@ this.tried = false

this.proven = true
this.attempts = 0
this.connectedTime = Date.now()
}
_disconnected () {
if (this.connectedTime > -1) {
if ((Date.now() - this.connectedTime) >= MIN_CONNECTION_TIME) this.attempts = 0 // fast retry
this.connectedTime = -1
}
this.attempts++

@@ -69,0 +76,0 @@ }

{
"name": "hyperswarm",
"version": "4.7.3",
"version": "4.7.4",
"description": "A distributed networking stack for connecting peers",

@@ -5,0 +5,0 @@ "files": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc